Skip to content

Commit

Permalink
Revert "Revert "Handle empty assignments `Manager::getPermissionsByUs…
Browse files Browse the repository at this point in the history
…erId()`""

This reverts commit 92bde66.
  • Loading branch information
arogachev committed Dec 18, 2023
1 parent 92bde66 commit 65c560a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
- Enh #204: Add simple storages for items and assignments (@arogachev)
- Chg #217: Raise PHP version to 8.1 (@arogachev)
- Bug #221: Exclude items with base names when getting children (@arogachev)
- Bug #222: Adjust hierarchy when removing item (@arogachev)
- Bug #222: Adjust hierarchy when removing item (@arogachev)
- Bug #?: Handle empty assignments in `Manager::getPermissionsByUserId()` (@arogachev)

## 1.0.2 April 20, 2023

Expand Down
4 changes: 4 additions & 0 deletions src/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ public function getPermissionsByUserId(int|Stringable|string $userId): array
{
$userId = (string) $userId;
$assignments = $this->assignmentsStorage->getByUserId($userId);
if (empty($assignments)) {
return [];
}

$assignmentNames = array_keys($assignments);

return array_merge(
Expand Down

0 comments on commit 65c560a

Please sign in to comment.