mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
User: Add property $unrestricted
This commit is contained in:
parent
8c147c1b2f
commit
5dfa5e28da
@ -206,6 +206,7 @@ class AdmissionLoader
|
||||
}
|
||||
}
|
||||
|
||||
$user->setIsUnrestricted($isUnrestricted);
|
||||
$user->setRestrictions($isUnrestricted ? [] : $restrictions);
|
||||
$user->setPermissions($permissions);
|
||||
$user->setRoles(array_values($roles));
|
||||
|
@ -73,6 +73,13 @@ class User
|
||||
*/
|
||||
protected $externalUserInformation = array();
|
||||
|
||||
/**
|
||||
* Whether restrictions should not apply to this user
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $unrestricted = false;
|
||||
|
||||
/**
|
||||
* Set of permissions
|
||||
*
|
||||
@ -202,6 +209,30 @@ class User
|
||||
return in_array($group, $this->groups);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether restrictions should not apply to this user
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isUnrestricted()
|
||||
{
|
||||
return $this->unrestricted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set whether restrictions should not apply to this user
|
||||
*
|
||||
* @param bool $state
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setIsUnrestricted($state)
|
||||
{
|
||||
$this->unrestricted = (bool) $state;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user's permissions
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user