Skip to content

Commit

Permalink
Merge pull request #6 from geekcell/fix/loosen-user-interface-check
Browse files Browse the repository at this point in the history
fix: remove UserInterface check for can/cannot methods
  • Loading branch information
janvt authored Dec 19, 2023
2 parents 07f7c07 + adda951 commit aae85a0
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 aae85a0

Please sign in to comment.