Interface BatchAccessChecker
- All Known Implementing Classes:
AbstractBatchAccessChecker
The purpose of the BatchAccessChecker is to accept all required checks via the
can...() methods and return the result of these "can do xyz" checks via check().
The checks make sure that a particular role is allowed to perform an action (such as creation,
deletion) on a NamedRef (Branch/Tag). Additionally, this interface also provides checks
based on a given ContentKey.
It is safe to call a check method with the same arguments multiple times.
Implementations can expect that either check() or checkAndThrow() are called
either once or never.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncanAssignRefToHash(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to assign the givenBranch/Tagto a commit id.canCommitChangeAgainstReference(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to commit changes against the givenBranch/TagorDetached.canCreateEntity(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to create a new entity value as defined by theIdentifiedContentKeyfor the givenBranch, called for aOperation.Putoperation in a commit.canCreateReference(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to create aBranch/Tag.canDeleteEntity(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to delete an entity value as defined by theContentKeyfor the givenBranch, called for aOperation.Deleteoperation in a commit.canDeleteReference(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to delete aBranch/Tag.canListCommitLog(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to list the commit log for the givenBranch/TagorDetached.canReadContentKey(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Called for every content-key about to be returned from, for example, a "get commit log" operation.canReadEntityValue(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to read an entity value as defined by theContentKeyfor the givenBranch/TagorDetached.canReadEntries(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to read entries content for the givenBranch/TagorDetached.canReadRepositoryConfig(org.projectnessie.model.RepositoryConfig.Type repositoryConfigType) canUpdateEntity(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to update an existing entity value as defined by theIdentifiedContentKeyfor the givenBranch, called for aOperation.Putoperation in a commit.canUpdateRepositoryConfig(org.projectnessie.model.RepositoryConfig.Type repositoryConfigType) canViewReference(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to view/list the givenBranch/TagorDetached.check()Checks the recorded checks.default voidConvenience methods that throws anAccessCheckException, ifcheck()returns a non-empty map.static voidthrowForFailedChecks(Map<Check, String> failedChecks)
-
Method Details
-
check
Checks the recorded checks.- Returns:
- map of failed checks or an empty collection, if all checks passed
-
checkAndThrow
Convenience methods that throws anAccessCheckException, ifcheck()returns a non-empty map.- Throws:
AccessCheckException
-
throwForFailedChecks
- Throws:
AccessCheckException
-
can
-
canViewReference
Checks whether the given role/principal is allowed to view/list the givenBranch/TagorDetached.- Parameters:
ref- TheNamedRefto check
-
canCreateReference
@CanIgnoreReturnValue BatchAccessChecker canCreateReference(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to create aBranch/Tag.- Parameters:
ref- TheNamedRefto check
-
canAssignRefToHash
@CanIgnoreReturnValue BatchAccessChecker canAssignRefToHash(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to assign the givenBranch/Tagto a commit id.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto check not granted.
-
canDeleteReference
@CanIgnoreReturnValue BatchAccessChecker canDeleteReference(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to delete aBranch/Tag.- Parameters:
ref- TheNamedRefto check
-
canReadEntries
Checks whether the given role/principal is allowed to read entries content for the givenBranch/TagorDetached.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto check
-
canReadContentKey
@CanIgnoreReturnValue BatchAccessChecker canReadContentKey(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Called for every content-key about to be returned from, for example, a "get commit log" operation.This is an additional check for each content-key. "Early" checks, that run before generating the result, like
canReadEntries(NamedRef)orcanListCommitLog(NamedRef), run as well.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- current referenceidentifiedKey- content key / ID / type to check
-
canListCommitLog
Checks whether the given role/principal is allowed to list the commit log for the givenBranch/TagorDetached.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto check
-
canCommitChangeAgainstReference
@CanIgnoreReturnValue BatchAccessChecker canCommitChangeAgainstReference(org.projectnessie.versioned.NamedRef ref) Checks whether the given role/principal is allowed to commit changes against the givenBranch/TagorDetached.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto check
-
canReadEntityValue
@CanIgnoreReturnValue BatchAccessChecker canReadEntityValue(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to read an entity value as defined by theContentKeyfor the givenBranch/TagorDetached.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto checkidentifiedKey- content key / ID / type to check
-
canCreateEntity
@CanIgnoreReturnValue BatchAccessChecker canCreateEntity(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to create a new entity value as defined by theIdentifiedContentKeyfor the givenBranch, called for aOperation.Putoperation in a commit.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto checkidentifiedKey- content key / ID / type to check
-
canUpdateEntity
@CanIgnoreReturnValue BatchAccessChecker canUpdateEntity(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to update an existing entity value as defined by theIdentifiedContentKeyfor the givenBranch, called for aOperation.Putoperation in a commit.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto checkidentifiedKey- content key / ID / type to check
-
canDeleteEntity
@CanIgnoreReturnValue BatchAccessChecker canDeleteEntity(org.projectnessie.versioned.NamedRef ref, org.projectnessie.model.IdentifiedContentKey identifiedKey) Checks whether the given role/principal is allowed to delete an entity value as defined by theContentKeyfor the givenBranch, called for aOperation.Deleteoperation in a commit.Adds an implicit
canViewReference(NamedRef).- Parameters:
ref- TheNamedRefto checkidentifiedKey- content key / ID / type to check
-
canReadRepositoryConfig
@CanIgnoreReturnValue BatchAccessChecker canReadRepositoryConfig(org.projectnessie.model.RepositoryConfig.Type repositoryConfigType) -
canUpdateRepositoryConfig
@CanIgnoreReturnValue BatchAccessChecker canUpdateRepositoryConfig(org.projectnessie.model.RepositoryConfig.Type repositoryConfigType)
-