Пример #1
0
 /**
  * @see \Vero\ACL\ACL::check()
  * @return boolean
  */
 public function check($key, $role = null)
 {
     if (!$this->acl) {
         $this->acl = $this->container->get($this->service);
     }
     return $this->acl->check($key, $role);
 }
Пример #2
0
 /**
  * Check current user's access to this action 
  * and throw exception in case of fail.
  * 
  * If key is unspecified, get Route ID of current request action.
  * 
  * @param string|null
  * @return true
  * @throws \Vero\Web\Exception\AccessDenied
  */
 public function aclCheck($key = null)
 {
     if (!$key) {
         $key = $this->get('request')->action;
     }
     if (!$this->acl->check($key)) {
         throw $this->accessDenied($key);
     }
     return true;
 }