Nette\Security\Permission::getRoleParents PHP Method

getRoleParents() public method

Returns existing Role's parents ordered by ascending priority.
public getRoleParents ( $role ) : array
return array
    public function getRoleParents($role)
    {
        $this->checkRole($role);
        return array_keys($this->roles[$role]['parents']);
    }

Usage Example

コード例 #1
0
ファイル: UserManager.php プロジェクト: klajmajk/futro
 /**
  * Recursivelly returns current and all parent roles
  * @param type $role
  * @return type
  */
 public function getEffectiveRoles($role)
 {
     $roles = array($role => TRUE);
     foreach ($this->acl->getRoleParents($role) as $parent) {
         $roles += array_flip($this->getEffectiveRoles($parent));
     }
     return array_keys($roles);
 }
All Usage Examples Of Nette\Security\Permission::getRoleParents