Scalr_Account_User::getAclRolesByEnvironment PHP Method

getAclRolesByEnvironment() public method

Gets roles by specified ID of environment
public getAclRolesByEnvironment ( integer $envId, boolean $ignoreCache = false ) : Scalr\Acl\Role\AccountRoleSuperposition
$envId integer The ID of the client's environment
$ignoreCache boolean optional Ignore cache.
return Scalr\Acl\Role\AccountRoleSuperposition Returns the list of the roles of account level by specified environment
    public function getAclRolesByEnvironment($envId, $ignoreCache = false)
    {
        $cid = 'roles.env';
        if (!isset($this->_cache[$cid][$envId]) || $ignoreCache) {
            $this->_cache[$cid][$envId] = \Scalr::getContainer()->acl->getUserRolesByEnvironment($this, $envId, $this->accountId);
        }
        return $this->_cache[$cid][$envId];
    }

Usage Example

Example #1
0
 /**
  * Gets acl roles superposition for the request
  *
  * @return \Scalr\Acl\Role\AccountRoleSuperposition
  */
 protected function getAclRoles()
 {
     if (!$this->aclRoles) {
         $this->aclRoles = $this->user->getAclRolesByEnvironment($this->Environment->id);
     }
     return $this->aclRoles;
 }
All Usage Examples Of Scalr_Account_User::getAclRolesByEnvironment