Fix #621: acl:AuthenticatedAgent instead of foaf:AuthenticatedAgent

This commit is contained in:
Michiel de Jong 2021-02-18 15:14:45 +01:00 committed by Ruben Verborgh
parent 4efe9cee3c
commit 91791a0a14
3 changed files with 4 additions and 4 deletions

View File

@ -169,7 +169,7 @@ export class WebAclAuthorizer extends Authorizer {
if (typeof agent.webId !== 'string') {
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 store.countQuads(auth, ACL.agent, agent.webId, null) > 0;

View File

@ -59,6 +59,7 @@ export const ACL = createUriAndTermNamespace('http://www.w3.org/ns/auth/acl#',
'accessTo',
'agent',
'agentClass',
'AuthenticatedAgent',
'default',
'mode',
@ -79,7 +80,6 @@ export const DC = createUriAndTermNamespace('http://purl.org/dc/terms/',
export const FOAF = createUriAndTermNamespace('http://xmlns.com/foaf/0.1/',
'Agent',
'AuthenticatedAgent',
);
export const HTTP = createUriAndTermNamespace('urn:solid:http:',

View File

@ -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> => {
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}mode`), nn(`${acl}Read`)),
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> => {
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}mode`), nn(`${acl}Read`)),
quad(nn('auth'), nn(`${acl}mode`), nn(`${acl}Write`)),