library/Garp/Auth.php
public function getRoleParents($role, $onlyParents = true) {
        $parents = array();
        if (Zend_Registry::isRegistered('Zend_Acl')) {
            $acl = Zend_Registry::get('Zend_Acl');
            $roles = $acl->getRoles();

            foreach ($roles as $potentialParent) {
                if ($acl->inheritsRole($role, $potentialParent, $onlyParents)) {
                    $parents[] = $potentialParent;
                }
            }
        }
        return $parents;
    }
public function getRoleParents($role, $onlyParents = true) {
        $parents = array();
        if (Zend_Registry::isRegistered('Zend_Acl')) {
            $acl = Zend_Registry::get('Zend_Acl');
            $roles = $acl->getRoles();

            foreach ($roles as $potentialParent) {
                if ($acl->inheritsRole($role, $potentialParent, $onlyParents)) {
                    $parents[] = $potentialParent;
                }
            }
        }
        return $parents;
    }
public function getRoleParents ( $ role , $ onlyParents = true ) { $ parents = array ( ) ; if ( Zend_Registry :: isRegistered ( 'Zend_Acl' ) ) { $ acl = Zend_Registry :: get ( 'Zend_Acl' ) ; $ roles = $ acl -> getRoles ( ) ; foreach ( $ roles as $ potentialParent ) { if ( $ acl -> inheritsRole ( $ role , $ potentialParent , $ onlyParents ) ) { $ parents [ ] = $ potentialParent ; } } } return $ parents ; }
Return the parents of a given role
@param String $role
@param Boolean $onlyParents Wether to only return direct parents
@return Array
Return the parents of a given role