Skip to content

A free open source IT asset/license management system

Added method for checking if the user can edit their own profile

snipe52c48853359a
diff --git a/app/Models/User.php b/app/Models/User.php
index 22291cd9cd..30e32061ed 100644
--- a/app/Models/User.php
+++ b/app/Models/User.php
@@ -204,6 +204,23 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
return $this->checkPermissionSection('superuser');
}
+
+ /**
+ * Checks if the can edit their own profile
+ *
+ * @author A. Gianotto <[email protected]>
+ * @since [v6.3.4]
+ * @return bool
+ */
+ public function canEditProfile() : bool {
+
+ $setting = Setting::getSettings();
+ if ($setting->profile_edit == 1) {
+ return true;
+ }
+ return false;
+ }
+
/**
* Checks if the user is deletable
*