Beispiel #1
0
 /**
  * Determines whether or not a consumer can view a resource.
  *
  * @param $rule
  * @param $resource
  * @return bool
  */
 private function can($rule, $resource)
 {
     // Guest access allowed
     if ('guest' == $rule) {
         return $this->permit();
     }
     if ($this->authority->can($rule, $resource)) {
         return $this->permit();
     }
     return false;
 }
 public function getAliasesForAction($action)
 {
     $action = (array) $action;
     $results = [];
     foreach ($this->getAliasedActions() as $aliasedAction => $actions) {
         if (array_intersect($action, $actions)) {
             $results = array_merge($results, parent::getAliasesForAction($aliasedAction));
         }
     }
     return array_unique($results);
 }