mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Fixed error when user has no permissions values
This commit is contained in:
parent
485fb26393
commit
95f94c1cfb
|
@ -39,7 +39,6 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
];
|
||||
|
||||
|
||||
// This is very coarse and should be changed
|
||||
public function hasAccess($section)
|
||||
{
|
||||
|
||||
|
@ -56,7 +55,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
|
||||
$user_permissions = json_decode($this->permissions, true);
|
||||
|
||||
if ((array_key_exists($section, $user_permissions)) && ($user_permissions[$section]=='1')) {
|
||||
if (($user_permissions!='') && ((array_key_exists($section, $user_permissions)) && ($user_permissions[$section]=='1')) ) {
|
||||
$permitted = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue