예제 #1
0
 /**
  * Get the given user's roles.
  *
  * @param  \Illuminate\Database\Eloquent\Model  $user
  * @return \Illuminate\Support\Collection
  */
 public function getRoles(Model $user)
 {
     $key = $this->tag . '-roles-' . $user->getKey();
     return $this->cache->sear($key, function () use($user) {
         return parent::getRoles($user);
     });
 }
예제 #2
0
 /**
  * Check if the user has all of the given roles.
  *
  * @param  string  $role
  * @return bool
  */
 public function all($role)
 {
     $roles = func_get_args();
     return $this->clipboard->checkRole($this->user, $roles, 'and');
 }