예제 #1
0
 public static function isHandlerPermitted($resource, $action)
 {
     if (!Access::isPrivate($resource, $action)) {
         return true;
     }
     if (empty(self::$config)) {
         self::$config = Config::load('access');
     }
     $group = '';
     if (!empty(self::$config['auth'])) {
         $cl = self::$config['auth'];
         $cl::init();
         if (!$cl::check()) {
             return false;
         }
         $group = $cl::group();
     }
     return Access::isPermitted($resource, $action, $group);
 }
예제 #2
0
파일: Access.php 프로젝트: pinahq/framework
 private static function sort()
 {
     usort(self::$data, function ($a, $b) {
         return $b[self::ACCESS_FIELD_PRIORITY] - $a[self::ACCESS_FIELD_PRIORITY];
     });
     self::$sorted = true;
 }