コード例 #1
0
ファイル: RAuthorizer.php プロジェクト: agungputrap/ssc
 /**
  * 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;
 }
コード例 #2
0
ファイル: RAuthorizer.php プロジェクト: pramana08/GXC-CMS-2
 /**
  * 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;
 }