Example #1
0
 /**
  * @param String $resource
  * Check whether the given resource can be accessed by the user for 
  * atleast one level. Return false if the user cannot access that page
  * for any of the level
  */
 public function has_access($resource)
 {
     if (Acl_Config::is_resource_ignored($resource)) {
         return true;
     }
     $levels = Arr::get($this->_permissions, $resource, null);
     if (is_null($levels)) {
         return False;
     }
     foreach ($levels as $level => $permit) {
         // if atleast one is permitted then allow access
         if ($permit) {
             return true;
         }
     }
     return false;
 }