mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Use PermissionReaders to determine available permissions
These readers will determine which permissions are available for the incoming credentials. Their results then get combined in a UnionReader and authorized in a PermissionBasedAuthorizer
This commit is contained in:
@@ -40,4 +40,15 @@ describe('A WacAllowMetadataWriter', (): void => {
|
||||
'wac-allow': 'user="read write"',
|
||||
});
|
||||
});
|
||||
|
||||
it('applies public modes to user modes.', async(): Promise<void> => {
|
||||
const metadata = new RepresentationMetadata({
|
||||
[AUTH.publicMode]: [ ACL.terms.Read, ACL.terms.Write ],
|
||||
});
|
||||
await expect(writer.handle({ response, metadata })).resolves.toBeUndefined();
|
||||
|
||||
expect(response.getHeaders()).toEqual({
|
||||
'wac-allow': 'user="read write",public="read write"',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user