Skip to content

Commit

Permalink
feat: prevent double role assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed Dec 20, 2024
1 parent 9ba88ab commit 6bc7f06
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Auth/UsesRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public function assign($role): bool
return false;
}

if (in_array($role, $this->roles)) {
return true;
}

$roleKey = Config::get('roles.key');

$this->setRolesAndPermissions($role);
Expand Down

0 comments on commit 6bc7f06

Please sign in to comment.