Example #1
0
 /**
  * Check a user's access.
  *
  * @param string|string[] $permissions
  * @param bool            $all
  *
  * @return bool
  */
 public function hasAccess($permissions, $all = true)
 {
     $key = sha1(json_encode($permissions) . json_encode($all));
     if (!array_key_exists($key, $this->access)) {
         $this->access[$key] = parent::hasAccess($permissions, $all);
     }
     return $this->access[$key];
 }