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

@@ -66,7 +66,7 @@ export class AuthorizingHttpHandler extends OperationHttpHandler {
const modes = await this.modesExtractor.handleSafe(operation);
this.logger.verbose(`Required modes are read: ${[ ...modes ].join(',')}`);
const permissionSet = await this.permissionReader.handleSafe({ credentials, identifier: operation.target });
const permissionSet = await this.permissionReader.handleSafe({ credentials, identifier: operation.target, modes });
this.logger.verbose(`Available permissions are ${JSON.stringify(permissionSet)}`);
try {