diff --git a/app/Models/User.php b/app/Models/User.php index 71fa797dcb..1dc59b1ba9 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -126,12 +126,13 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo $user_permissions = json_decode($this->permissions, true); + $is_user_section_permissions_set = ($user_permissions != '') && array_key_exists($section, $user_permissions); //If the user is explicitly granted, return true - if (($user_permissions!='') && ((array_key_exists($section, $user_permissions)) && ($user_permissions[$section]=='1'))) { + if ($is_user_section_permissions_set && ($user_permissions[$section]=='1')) { return true; } // If the user is explicitly denied, return false - if (($user_permissions=='') || array_key_exists($section, $user_permissions) && ($user_permissions[$section]=='-1')) { + if ($is_user_section_permissions_set && ($user_permissions[$section]=='-1')) { return false; }