refactor: Rename associated resource to subject resource

This commit is contained in:
Joachim Van Herwegen
2021-10-07 16:38:25 +02:00
parent 13c49045d4
commit 7c7fee5f5c
20 changed files with 93 additions and 93 deletions

View File

@@ -8,8 +8,8 @@ import { PermissionReader } from './PermissionReader';
/**
* A PermissionReader for auxiliary resources such as acl or shape resources.
* The access permissions of an auxiliary resource depend on those of the resource it is associated with.
* This authorizer calls the source authorizer with the identifier of the associated resource.
* By default, the access permissions of an auxiliary resource depend on those of its subject resource.
* This authorizer calls the source authorizer with the identifier of the subject resource.
*/
export class AuxiliaryReader extends PermissionReader {
protected readonly logger = getLoggerFor(this);
@@ -51,7 +51,7 @@ export class AuxiliaryReader extends PermissionReader {
return {
...auxiliaryAuth,
identifier: this.auxiliaryStrategy.getAssociatedIdentifier(auxiliaryAuth.identifier),
identifier: this.auxiliaryStrategy.getSubjectIdentifier(auxiliaryAuth.identifier),
};
}
}

View File

@@ -62,7 +62,7 @@ export class WebAclReader extends PermissionReader {
this.logger.debug(`Retrieving permissions of ${credentials.agent?.webId} for ${identifier.path}`);
const isAcl = this.aclStrategy.isAuxiliaryIdentifier(identifier);
const mainIdentifier = isAcl ? this.aclStrategy.getAssociatedIdentifier(identifier) : identifier;
const mainIdentifier = isAcl ? this.aclStrategy.getSubjectIdentifier(identifier) : identifier;
// Determine the full authorization for the agent granted by the applicable ACL
const acl = await this.getAclRecursive(mainIdentifier);