getRoleParents() public method

Returns existing Role's parents ordered by ascending priority.
public getRoleParents ( $role ) : array
return array
Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 public function getRoles($role)
 {
     $roles = array_merge(array($role), $this->acl->getRoleParents($role));
     return $roles;
 }