mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
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:
@@ -23,12 +23,12 @@ describe('An AllStaticReader', (): void => {
|
||||
|
||||
it('always returns permissions matching the given allow parameter.', async(): Promise<void> => {
|
||||
let authorizer = new AllStaticReader(true);
|
||||
await expect(authorizer.handle({ credentials, identifier })).resolves.toEqual({
|
||||
await expect(authorizer.handle({ credentials, identifier, modes: new Set() })).resolves.toEqual({
|
||||
[CredentialGroup.agent]: getPermissions(true),
|
||||
});
|
||||
|
||||
authorizer = new AllStaticReader(false);
|
||||
await expect(authorizer.handle({ credentials, identifier })).resolves.toEqual({
|
||||
await expect(authorizer.handle({ credentials, identifier, modes: new Set() })).resolves.toEqual({
|
||||
[CredentialGroup.agent]: getPermissions(false),
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user