-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly handle acl behaviour for acl identifiers
- Loading branch information
Showing
7 changed files
with
77 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
import type { ResourceIdentifier } from '../ldp/representation/ResourceIdentifier'; | ||
|
||
/** | ||
* Handles where acl files are stored. | ||
* Handles where acl resources are stored. | ||
*/ | ||
export interface AclManager { | ||
/** | ||
* Returns the identifier of the acl file corresponding to the given resource. | ||
* This does not guarantee that this acl file exists. | ||
* In the case the input is already an acl file that will also be the response. | ||
* @param id - The ResourceIdentifier of which we need the corresponding acl file. | ||
* Returns the identifier of the acl resource corresponding to the given resource. | ||
* This does not guarantee that this acl resource exists. | ||
* In the case the input is already an acl resource that will also be the response. | ||
* @param id - The ResourceIdentifier of which we need the corresponding acl resource. | ||
* | ||
* @returns The ResourceIdentifier of the corresponding acl file. | ||
* @returns The ResourceIdentifier of the corresponding acl resource. | ||
*/ | ||
getAcl: (id: ResourceIdentifier) => Promise<ResourceIdentifier>; | ||
getAclDocument: (id: ResourceIdentifier) => Promise<ResourceIdentifier>; | ||
|
||
/** | ||
* Checks if the input identifier corresponds to an acl file. | ||
* This does not check if that acl file exists, | ||
* only if the identifier indicates that there could be an acl file there. | ||
* Checks if the input identifier corresponds to an acl resource. | ||
* This does not check if that acl resource exists, | ||
* only if the identifier indicates that there could be an acl resource there. | ||
* @param id - Identifier to check. | ||
* | ||
* @returns true if the input identifier points to an acl file. | ||
* @returns true if the input identifier points to an acl resource. | ||
*/ | ||
isAcl: (id: ResourceIdentifier) => Promise<boolean>; | ||
isAclDocument: (id: ResourceIdentifier) => Promise<boolean>; | ||
|
||
/** | ||
* Returns the identifier of the resource on which the acl constraints are placed. | ||
* In general, this is the resource identifier when the input is a normal resource, | ||
* or the non-acl version if the input is an acl resource. | ||
* This does not guarantee that this resource exists. | ||
* @param aclId - Identifier of the acl resource. | ||
* | ||
* @returns The ResourceIdentifier of the corresponding resource. | ||
*/ | ||
getAclConstrainedResource: (id: ResourceIdentifier) => Promise<ResourceIdentifier>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters