Skip to content

Commit

Permalink
Renamed no_access key to noAccess
Browse files Browse the repository at this point in the history
  • Loading branch information
ciastektk committed Dec 9, 2024
1 parent fc53371 commit b48f8c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/lib/Permission/Mapper/UsersWithPermissionInfoMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* }
* @phpstan-type TPermissionInfoData array{
* access: array<TUserData>,
* no_access: array<TUserData>,
* noAccess: array<TUserData>,
* }
*/
final class UsersWithPermissionInfoMapper
Expand Down Expand Up @@ -82,7 +82,7 @@ private function groupByPermissions(
): array {
$results = [
'access' => [],
'no_access' => [],
'noAccess' => [],
];

foreach ($searchResult as $result) {
Expand All @@ -99,7 +99,7 @@ private function groupByPermissions(
if ($this->permissionResolver->canUser($module, $function, $object, $targets)) {
$results['access'][] = $userData;
} else {
$results['no_access'][] = $userData;
$results['noAccess'][] = $userData;
}
}

Expand Down
12 changes: 6 additions & 6 deletions tests/integration/REST/GetUsersWithPermissionInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable
self::MODULE_CONTENT,
self::FUNCTION_READ,
['contentId' => 41],
'{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"John Doe","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"no_access":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"[email protected]"}]}',
'{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"John Doe","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"noAccess":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"[email protected]"}]}',
];

yield 'Check content-read for content item 41 and location 51' => [
Expand All @@ -100,7 +100,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable
'contentId' => 41,
'locationId' => 51,
],
'{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"John Doe","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"no_access":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"[email protected]"}]}',
'{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"John Doe","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"noAccess":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"[email protected]"}]}',
];

yield 'Check content-read for phrase=undef*' => [
Expand All @@ -111,7 +111,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable
'contentId' => 41,
'phrase' => 'undef*',
],
'{"access":[],"no_access":[]}',
'{"access":[],"noAccess":[]}',
];

yield 'Check content-edit for content item 2 and phrase=jo' => [
Expand All @@ -122,7 +122,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable
'contentId' => 41,
'phrase' => 'jo*',
],
'{"access":[{"id":"__FIXED_ID__","name":"John Doe","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"no_access":[]}',
'{"access":[{"id":"__FIXED_ID__","name":"John Doe","email":"[email protected]"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"noAccess":[]}',
];

yield 'Check content-edit for content item 41 and phrase=bar*' => [
Expand All @@ -133,7 +133,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable
'contentId' => 41,
'phrase' => 'bar*',
],
'{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"no_access":[]}',
'{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"noAccess":[]}',
];

yield 'Check content-edit for content item 41 and location 43 and [email protected]' => [
Expand All @@ -145,7 +145,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable
'contentId' => 41,
'locationId' => self::MEDIA_LOCATION_ID,
],
'{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"no_access":[]}',
'{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"[email protected]"}],"noAccess":[]}',
];
}

Expand Down

0 comments on commit b48f8c9

Please sign in to comment.