Skip to content

Commit

Permalink
[8.x] Add canany to user model (#34815)
Browse files Browse the repository at this point in the history
* add canany to user model

* changed method name
  • Loading branch information
denisdulici authored Oct 13, 2020
1 parent d004392 commit 5a165e0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Illuminate/Foundation/Auth/Access/Authorizable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ public function can($abilities, $arguments = [])
return app(Gate::class)->forUser($this)->check($abilities, $arguments);
}

/**
* Determine if the entity has any of the given abilities.
*
* @param iterable|string $abilities
* @param array|mixed $arguments
* @return bool
*/
public function canAny($abilities, $arguments = [])
{
return app(Gate::class)->forUser($this)->any($abilities, $arguments);
}

/**
* Determine if the entity does not have the given abilities.
*
Expand Down

0 comments on commit 5a165e0

Please sign in to comment.