Exemple #1
0
 /**
  * @param $permission
  *
  * @return mixed
  */
 public function hasPermission($permission)
 {
     if (is_string($permission)) {
         $permission = Permission::findByLabel($permission);
     }
     return $this->permissions->contains('name', $permission->name);
 }
 /**
  * @param $permission
  *
  * @return bool
  */
 public function hasPermission($permission)
 {
     if (is_string($permission)) {
         $permission = Permission::findByLabel($permission);
     }
     return $this->hasRole($permission->roles);
 }