mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
Fix #621: acl:AuthenticatedAgent instead of foaf:AuthenticatedAgent
This commit is contained in:
parent
4efe9cee3c
commit
91791a0a14
@ -169,7 +169,7 @@ export class WebAclAuthorizer extends Authorizer {
|
|||||||
if (typeof agent.webId !== 'string') {
|
if (typeof agent.webId !== 'string') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (store.countQuads(auth, ACL.agentClass, FOAF.AuthenticatedAgent, null) > 0) {
|
if (store.countQuads(auth, ACL.agentClass, ACL.AuthenticatedAgent, null) > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return store.countQuads(auth, ACL.agent, agent.webId, null) > 0;
|
return store.countQuads(auth, ACL.agent, agent.webId, null) > 0;
|
||||||
|
@ -59,6 +59,7 @@ export const ACL = createUriAndTermNamespace('http://www.w3.org/ns/auth/acl#',
|
|||||||
'accessTo',
|
'accessTo',
|
||||||
'agent',
|
'agent',
|
||||||
'agentClass',
|
'agentClass',
|
||||||
|
'AuthenticatedAgent',
|
||||||
'default',
|
'default',
|
||||||
'mode',
|
'mode',
|
||||||
|
|
||||||
@ -79,7 +80,6 @@ export const DC = createUriAndTermNamespace('http://purl.org/dc/terms/',
|
|||||||
|
|
||||||
export const FOAF = createUriAndTermNamespace('http://xmlns.com/foaf/0.1/',
|
export const FOAF = createUriAndTermNamespace('http://xmlns.com/foaf/0.1/',
|
||||||
'Agent',
|
'Agent',
|
||||||
'AuthenticatedAgent',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
export const HTTP = createUriAndTermNamespace('urn:solid:http:',
|
export const HTTP = createUriAndTermNamespace('urn:solid:http:',
|
||||||
|
@ -102,7 +102,7 @@ describe('A WebAclAuthorizer', (): void => {
|
|||||||
|
|
||||||
it('allows access to authorized agents if the acl files allows all authorized users.', async(): Promise<void> => {
|
it('allows access to authorized agents if the acl files allows all authorized users.', async(): Promise<void> => {
|
||||||
store.getRepresentation = async(): Promise<Representation> => ({ data: guardedStreamFrom([
|
store.getRepresentation = async(): Promise<Representation> => ({ data: guardedStreamFrom([
|
||||||
quad(nn('auth'), nn(`${acl}agentClass`), nn('http://xmlns.com/foaf/0.1/AuthenticatedAgent')),
|
quad(nn('auth'), nn(`${acl}agentClass`), nn(`${acl}AuthenticatedAgent`)),
|
||||||
quad(nn('auth'), nn(`${acl}accessTo`), nn(identifier.path)),
|
quad(nn('auth'), nn(`${acl}accessTo`), nn(identifier.path)),
|
||||||
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Read`)),
|
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Read`)),
|
||||||
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Write`)),
|
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Write`)),
|
||||||
@ -114,7 +114,7 @@ describe('A WebAclAuthorizer', (): void => {
|
|||||||
|
|
||||||
it('errors if authorization is required but the agent is not authorized.', async(): Promise<void> => {
|
it('errors if authorization is required but the agent is not authorized.', async(): Promise<void> => {
|
||||||
store.getRepresentation = async(): Promise<Representation> => ({ data: guardedStreamFrom([
|
store.getRepresentation = async(): Promise<Representation> => ({ data: guardedStreamFrom([
|
||||||
quad(nn('auth'), nn(`${acl}agentClass`), nn('http://xmlns.com/foaf/0.1/AuthenticatedAgent')),
|
quad(nn('auth'), nn(`${acl}agentClass`), nn(`${acl}AuthenticatedAgent`)),
|
||||||
quad(nn('auth'), nn(`${acl}accessTo`), nn(identifier.path)),
|
quad(nn('auth'), nn(`${acl}accessTo`), nn(identifier.path)),
|
||||||
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Read`)),
|
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Read`)),
|
||||||
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Write`)),
|
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Write`)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user