mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Added method for checking if the user can edit their own profile
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
aa5fe52e89
commit
52c4885335
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue