Package sonia.scm.repository
Interface RepositoryPermissionHolder
- All Known Implementing Classes:
Namespace,Repository
public interface RepositoryPermissionHolder
This abstracts the permissions of
Repository and Namespace objects.-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPermission(RepositoryPermission newPermission) Adds a single permission to the current set of permissions for this object.default Optional<RepositoryPermission>findGroupPermission(String groupId) Returns the permission for the given group, if present, or an emptyOptionalotherwise.default Optional<RepositoryPermission>findUserPermission(String userId) Returns the permission for the given user, if present, or an emptyOptionalotherwise.Returns a collection of all permissions for this object.booleanremovePermission(RepositoryPermission permission) Removes a single permission from the current set of permissions for this object.voidsetPermissions(Collection<RepositoryPermission> permissions) Sets and therefore overwrites the permissions for this object.
-
Method Details
-
getPermissions
Collection<RepositoryPermission> getPermissions()Returns a collection of all permissions for this object. -
setPermissions
Sets and therefore overwrites the permissions for this object.- Parameters:
permissions- The new permissions for this object.
-
addPermission
Adds a single permission to the current set of permissions for this object.- Parameters:
newPermission- The new permission that will be added to the existing permissions.
-
removePermission
Removes a single permission from the current set of permissions for this object.- Parameters:
permission- The permission that should be removed from the existing permissions.- Returns:
true, if the given permission was part of the permissions for this object,falseotherwise.
-
findUserPermission
Returns the permission for the given user, if present, or an emptyOptionalotherwise.- Since:
- 2.38.0
-
findGroupPermission
Returns the permission for the given group, if present, or an emptyOptionalotherwise.- Since:
- 2.38.0
-