library/Garp/Auth.php
public function getRoles($verbose = false) {
        if (Zend_Registry::isRegistered('Zend_Acl')) {
            $acl = Zend_Registry::get('Zend_Acl');
            $roles = $acl->getRoles();

            // collect parents
            if ($verbose) {
                $roles = array_fill_keys($roles, array());
                foreach (array_keys($roles) as $role) {
                    $roles[$role]['parents'] = $this->getRoleParents($role);
                    $roles[$role]['children'] = $this->getRoleChildren($role);
                }
            }
            return $roles;
        }
        return array();
    }
public function getRoles($verbose = false) {
        if (Zend_Registry::isRegistered('Zend_Acl')) {
            $acl = Zend_Registry::get('Zend_Acl');
            $roles = $acl->getRoles();

            // collect parents
            if ($verbose) {
                $roles = array_fill_keys($roles, array());
                foreach (array_keys($roles) as $role) {
                    $roles[$role]['parents'] = $this->getRoleParents($role);
                    $roles[$role]['children'] = $this->getRoleChildren($role);
                }
            }
            return $roles;
        }
        return array();
    }
public function getRoles ( $ verbose = false ) { if ( Zend_Registry :: isRegistered ( 'Zend_Acl' ) ) { $ acl = Zend_Registry :: get ( 'Zend_Acl' ) ; $ roles = $ acl -> getRoles ( ) ; // collect parents if ( $ verbose ) { $ roles = array_fill_keys ( $ roles , array ( ) ) ; foreach ( array_keys ( $ roles ) as $ role ) { $ roles [ $ role ] [ 'parents' ] = $ this -> getRoleParents ( $ role ) ; $ roles [ $ role ] [ 'children' ] = $ this -> getRoleChildren ( $ role ) ; } } return $ roles ; } return array ( ) ; }
Return all available roles from the ACL tree.
@param Boolean $verbose Wether to include a role's parents
@return Array A numeric array consisting of role strings
Return all available roles from the ACL tree .