Esempio n. 1
0
 public function getAccessControlLists($admin=false) {
     $acls = array();
     $var = $admin ? 'adminacl' : 'acl';
     
     $aclStrings = array_merge(
         $this->getSiteVar($var, array(), Config::SUPRESS_ERRORS),
         $this->getModuleVar($var, array(), Config::SUPRESS_ERRORS)
     );
     
     foreach ($aclStrings as $aclString) {
         if ($acl = AccessControlList::createFromString($aclString)) {
             $acls[] = $acl;
         } else {
             throw new Exception("Invalid $var $aclString in $this->id");
         }
     }
     
     return $acls;
 }
 public function getAccessControlLists()
 {
   $acls = array();
   $aclStrings = $this->getModuleVar('acl', array(), Config::SUPRESS_ERRORS);
   foreach ($aclStrings as $aclString) {
       if ($acl = AccessControlList::createFromString($aclString)) {
           $acls[] = $acl;
       } else {
           throw new Exception("Invalid ACL $aclString in $this->id");
       }
   }
   
   return $acls;
 }
Esempio n. 3
0
 /**
   * Retrieves the access control lists 
   * @param bool $admin if true evaluate the admin acls
   * @return array of access control lists
   */
 protected function getAccessControlLists($type) {
     $acls = array();
     
     $aclStrings = array_merge(
         $this->getSiteVar($type, array(), Config::SUPRESS_ERRORS),
         $this->getModuleVar($type, array(), Config::SUPRESS_ERRORS)
     );
     
     foreach ($aclStrings as $aclString) {
         if ($acl = AccessControlList::createFromString($aclString)) {
             $acls[] = $acl;
         } else {
             throw new Exception("Invalid $var $aclString in $this->configModule");
         }
     }
     
     return $acls;
 }