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->setRestrictions($isUnrestricted ? [] : $restrictions);
|
||||||
$user->setPermissions($permissions);
|
$user->setPermissions($permissions);
|
||||||
$user->setRoles(array_values($roles));
|
$user->setRoles(array_values($roles));
|
||||||
|
|
|
@ -73,6 +73,13 @@ class User
|
||||||
*/
|
*/
|
||||||
protected $externalUserInformation = array();
|
protected $externalUserInformation = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether restrictions should not apply to this user
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $unrestricted = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set of permissions
|
* Set of permissions
|
||||||
*
|
*
|
||||||
|
@ -202,6 +209,30 @@ class User
|
||||||
return in_array($group, $this->groups);
|
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
|
* Get the user's permissions
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue