Skip to content

Commit

Permalink
Fix User::roles()
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed Sep 20, 2024
1 parent 2d974e0 commit dd62413
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/Cms/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,6 @@ public function roles(string|null $purpose = null): Roles
$kirby = $this->kirby();
$roles = $kirby->roles();

// for the last admin, only their current role (admin) is available
if ($this->isLastAdmin() === true) {
// a collection with just the one role of the user
return $roles->filter('id', $this->role()->id());
}

// filter roles based on the user action
// as user permissions and/or options can restrict these further
$roles = match ($purpose) {
Expand Down

0 comments on commit dd62413

Please sign in to comment.