Exemple #1
0
 public static function getControllerAccess($controller, $action)
 {
     $allowed = false;
     $amap = Controller::$accessMap;
     $controller = strtolower($controller);
     $action = strtolower($action);
     if (isset($amap[$controller]) && isset($amap[$controller][$action])) {
         $allowed = UserIdentity::check($amap[$controller][$action]);
     }
     return $allowed;
 }
Exemple #2
0
 public function accesRulesByAction($action)
 {
     $allowed = false;
     $amap = self::$accessMap;
     $controller = strtolower($this->getUniqueId());
     $action = strtolower($action->getId());
     if (isset($amap[$controller]) && isset($amap[$controller][$action])) {
         $allowed = UserIdentity::check($amap[$controller][$action]);
     }
     if ($allowed) {
         return array(array('allow', 'users' => array('*')));
     } else {
         return array(array('deny', 'users' => array('*')));
     }
 }