Example #1
0
 /**
  * Returns the access level of the user for the given plugin controller action path.
  *
  * @param array $url The url to get the access level for.
  * @return int|bool
  */
 public function getAccessLevel($url = null)
 {
     if ($url === null) {
         $url = Wasabi::getCurrentUrlArray();
     }
     $path = guardian()->getPathFromUrl($url);
     if (!array_key_exists($path, $this->permissions)) {
         return 0;
     }
     return $this->permissions[$path];
 }
Example #2
0
 /**
  * Allow all guest actions.
  *
  * @return void
  */
 protected function _allow()
 {
     $url = Wasabi::getCurrentUrlArray();
     if ($this->Guardian->isGuestAction($url)) {
         $this->Auth->allow($this->request->params['action']);
     }
 }