feat: Pass access modes to PermissionReaders

This allows PermissionReaders to potentially only check the necessary access modes
for potential performance optimization.
This commit is contained in:
Joachim Van Herwegen
2022-02-23 15:19:20 +01:00
parent 706f0d5316
commit 2ae5924dde
11 changed files with 69 additions and 40 deletions

View File

@@ -62,7 +62,7 @@ describe('An AuthorizingHttpHandler', (): void => {
expect(modesExtractor.handleSafe).toHaveBeenCalledTimes(1);
expect(modesExtractor.handleSafe).toHaveBeenLastCalledWith(operation);
expect(permissionReader.handleSafe).toHaveBeenCalledTimes(1);
expect(permissionReader.handleSafe).toHaveBeenLastCalledWith({ credentials, identifier: operation.target });
expect(permissionReader.handleSafe).toHaveBeenLastCalledWith({ credentials, identifier: operation.target, modes });
expect(authorizer.handleSafe).toHaveBeenCalledTimes(1);
expect(authorizer.handleSafe)
.toHaveBeenLastCalledWith({ credentials, identifier: operation.target, modes, permissionSet });