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;
    }