Skip to content

Commit

Permalink
remove UserInterface check for can/cannot methods
Browse files Browse the repository at this point in the history
  • Loading branch information
janvt committed Dec 19, 2023
1 parent 07f7c07 commit adda951
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Trait/HasPolicies.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ trait HasPolicies
*/
public function can(string $ability, mixed $subject, mixed ...$extraArgs): bool
{
$this->ensureUserInterface();

$methodArgs = [$this];
if (is_object($subject)) {
$methodArgs[] = $subject;
Expand Down Expand Up @@ -72,10 +70,12 @@ public function cannot(string $ability, mixed $subject = null, mixed ...$extraAr
}

/**
* Check if user has role
* Check if user has role.
* User must implement UserInterface.
*
* @param string $role
* @return bool
* @throws \BadMethodCallException
*/
public function is(string $role): bool
{
Expand Down

0 comments on commit adda951

Please sign in to comment.