mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Check for superuser
This commit is contained in:
parent
9a8e4a55e7
commit
8ca71df7c9
|
@ -42,6 +42,9 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
// This is very coarse and should be changed
|
||||
public function hasAccess($section)
|
||||
{
|
||||
if ($this->isSuperUser()) {
|
||||
return true;
|
||||
}
|
||||
$user_permissions = json_decode($this->permissions, true);
|
||||
$user_groups = $this->groups();
|
||||
|
||||
|
@ -65,6 +68,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
if (!$user_permissions = json_decode($this->permissions, true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$group_array = array();
|
||||
foreach ($this->groups() as $user_group) {
|
||||
$group_permissions = json_decode($user_group->permissions, true);
|
||||
|
|
Loading…
Reference in a new issue