components/AuthBehavior.php
private function getPermissions($items = null, $depth = 0)
    {
        $permissions = array();

        if ($items === null) {
            $items = $this->owner->getAuthItems();
        }

        foreach ($items as $itemName => $item) {
            $permissions[$itemName] = array(
                'name' => $itemName,
                'item' => $item,
                'children' => $this->getPermissions($item, $depth + 1),
                'depth' => $depth,
            );
        }

        return $permissions;
    }
private function getPermissions($items = null, $depth = 0)
    {
        $permissions = array();

        if ($items === null) {
            $items = $this->owner->getAuthItems();
        }

        foreach ($items as $itemName => $item) {
            $permissions[$itemName] = array(
                'name' => $itemName,
                'item' => $item,
                'children' => $this->getPermissions($item, $depth + 1),
                'depth' => $depth,
            );
        }

        return $permissions;
    }
private function getPermissions ( $ items = null , $ depth = 0 ) { $ permissions = array ( ) ; if ( $ items === null ) { $ items = $ this -> owner -> getAuthItems ( ) ; } foreach ( $ items as $ itemName => $ item ) { $ permissions [ $ itemName ] = array ( 'name' => $ itemName , 'item' => $ item , 'children' => $ this -> getPermissions ( $ item , $ depth + 1 ) , 'depth' => $ depth , ) ; } return $ permissions ; }
Returns the permission tree for the given items.
@param CAuthItem[] $items items to process. If omitted the complete tree will be returned.
@param integer $depth current depth.
@return array the permissions.
Returns the permission tree for the given items .