mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 13:44:06 -08:00
Cast group permissions as array for older, wonky installs
This commit is contained in:
parent
d4dc1830ec
commit
b450ef3534
|
@ -67,7 +67,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
|
||||
// Loop through the groups to see if any of them grant this permission
|
||||
foreach ($user_groups as $user_group) {
|
||||
$group_permissions = json_decode($user_group->permissions, true);
|
||||
$group_permissions = (array) json_decode($user_group->permissions, true);
|
||||
if (((array_key_exists($section, $group_permissions)) && ($group_permissions[$section]=='1'))) {
|
||||
return true;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
|
||||
foreach ($this->groups as $user_group) {
|
||||
$group_permissions = json_decode($user_group->permissions, true);
|
||||
$group_array = $group_permissions;
|
||||
$group_array = (array)$group_permissions;
|
||||
if ((array_key_exists('superuser', $group_array)) && ($group_permissions['superuser']=='1')) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue