/** * Returns the permissions for a specific authorization item recursively. * @param CAuthItem $item the item for which to get permissions. * @return array the section of the permissions tree. */ private function getPermissionsRecursive(CAuthItem $item) { $permissions = array(); foreach ($item->getChildren() as $childName => $child) { $permissions[$childName] = array(); if (($grandChildren = $this->getPermissionsRecursive($child)) !== array()) { $permissions[$childName] = $grandChildren; } } return $permissions; }
/** * Returns the permissions for a specific authorization item recursively. * @param CAuthItem $item the item for which to get permissions. * @return array the section of the permissions tree. */ private function getPermissionsWithBizRueRecursive(CAuthItem $item) { $permissions = array(); foreach ($item->getChildren() as $childName => $child) { $permissions[$childName]['items'] = array(); if (($grandChildren = $this->getPermissionsRecursive($child)) !== array()) { $permissions[$childName]['items'] = $grandChildren; } $permissions['bizRule'] = $child->bizRule; } return $permissions; }