refactor: Restructure source code folder

This way the location of certain classes should make more sense
This commit is contained in:
Joachim Van Herwegen
2021-10-08 10:58:35 +02:00
parent 012d9e0864
commit b3da9c9fcf
280 changed files with 684 additions and 673 deletions

View File

@@ -0,0 +1,15 @@
import { ACL } from '../../util/Vocabularies';
import type { AccessCheckerArgs } from './AccessChecker';
import { AccessChecker } from './AccessChecker';
/**
* Checks if the given WebID has been given access.
*/
export class AgentAccessChecker extends AccessChecker {
public async handle({ acl, rule, credential }: AccessCheckerArgs): Promise<boolean> {
if (typeof credential.webId === 'string') {
return acl.countQuads(rule, ACL.terms.agent, credential.webId, null) !== 0;
}
return false;
}
}