diff --git a/src/lib/Permission/Mapper/UsersWithPermissionInfoMapper.php b/src/lib/Permission/Mapper/UsersWithPermissionInfoMapper.php index 0a117ce4a8..0ed5fef0eb 100644 --- a/src/lib/Permission/Mapper/UsersWithPermissionInfoMapper.php +++ b/src/lib/Permission/Mapper/UsersWithPermissionInfoMapper.php @@ -24,7 +24,7 @@ * } * @phpstan-type TPermissionInfoData array{ * access: array, - * no_access: array, + * noAccess: array, * } */ final class UsersWithPermissionInfoMapper @@ -82,7 +82,7 @@ private function groupByPermissions( ): array { $results = [ 'access' => [], - 'no_access' => [], + 'noAccess' => [], ]; foreach ($searchResult as $result) { @@ -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; } } diff --git a/tests/integration/REST/GetUsersWithPermissionInfoTest.php b/tests/integration/REST/GetUsersWithPermissionInfoTest.php index cf535a0409..38a469f668 100644 --- a/tests/integration/REST/GetUsersWithPermissionInfoTest.php +++ b/tests/integration/REST/GetUsersWithPermissionInfoTest.php @@ -89,7 +89,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable self::MODULE_CONTENT, self::FUNCTION_READ, ['contentId' => 41], - '{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"admin@link.invalid"},{"id":"__FIXED_ID__","name":"John Doe","email":"john@link.invalid"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"no_access":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"anonymous@link.invalid"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"guest@link.invalid"}]}', + '{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"admin@link.invalid"},{"id":"__FIXED_ID__","name":"John Doe","email":"john@link.invalid"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"noAccess":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"anonymous@link.invalid"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"guest@link.invalid"}]}', ]; yield 'Check content-read for content item 41 and location 51' => [ @@ -100,7 +100,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable 'contentId' => 41, 'locationId' => 51, ], - '{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"admin@link.invalid"},{"id":"__FIXED_ID__","name":"John Doe","email":"john@link.invalid"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"no_access":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"anonymous@link.invalid"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"guest@link.invalid"}]}', + '{"access":[{"id":"__FIXED_ID__","name":"Administrator User","email":"admin@link.invalid"},{"id":"__FIXED_ID__","name":"John Doe","email":"john@link.invalid"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"noAccess":[{"id":"__FIXED_ID__","name":"Anonymous User","email":"anonymous@link.invalid"},{"id":"__FIXED_ID__","name":"Guest Guest","email":"guest@link.invalid"}]}', ]; yield 'Check content-read for phrase=undef*' => [ @@ -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' => [ @@ -122,7 +122,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable 'contentId' => 41, 'phrase' => 'jo*', ], - '{"access":[{"id":"__FIXED_ID__","name":"John Doe","email":"john@link.invalid"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"no_access":[]}', + '{"access":[{"id":"__FIXED_ID__","name":"John Doe","email":"john@link.invalid"},{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"noAccess":[]}', ]; yield 'Check content-edit for content item 41 and phrase=bar*' => [ @@ -133,7 +133,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable 'contentId' => 41, 'phrase' => 'bar*', ], - '{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"no_access":[]}', + '{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"noAccess":[]}', ]; yield 'Check content-edit for content item 41 and location 43 and phrase=joshua@link.invalid' => [ @@ -145,7 +145,7 @@ public function provideDataForTestGetUsersWithPermissionsEndpoint(): iterable 'contentId' => 41, 'locationId' => self::MEDIA_LOCATION_ID, ], - '{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"no_access":[]}', + '{"access":[{"id":"__FIXED_ID__","name":"Josh Bar","email":"joshua@link.invalid"}],"noAccess":[]}', ]; }