mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Rename associated resource to subject resource
This commit is contained in:
@@ -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),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user