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

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-06-24 14:02:17 +01:00
parent aa5fe52e89
commit 52c4885335

View file

@ -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 <snipe@snipe.net>
* @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
*