lib: Add User::getRoles() and ::setRoles()

refs #10887
This commit is contained in:
Eric Lippmann 2016-03-24 15:30:07 +01:00
parent 6ec1878977
commit 1aa42bdaf6

View File

@ -6,6 +6,7 @@ namespace Icinga;
use DateTimeZone; use DateTimeZone;
use InvalidArgumentException; use InvalidArgumentException;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Authentication\Role;
use Icinga\User\Preferences; use Icinga\User\Preferences;
use Icinga\Web\Navigation\Navigation; use Icinga\Web\Navigation\Navigation;
@ -238,6 +239,29 @@ class User
$this->restrictions = $restrictions; $this->restrictions = $restrictions;
} }
/**
* Get the roles of the user
*
* @return Role[]
*/
public function getRoles()
{
return $this->roles;
}
/**
* Set the roles of the user
*
* @param Role[] $roles
*
* @return $this
*/
public function setRoles(array $roles)
{
$this->roles = $roles;
return $this;
}
/** /**
* Getter for username * Getter for username
* *