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 TypeMethodDescriptionvoid
addPermission
(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 emptyOptional
otherwise.default Optional<RepositoryPermission>
findUserPermission
(String userId) Returns the permission for the given user, if present, or an emptyOptional
otherwise.Returns a collection of all permissions for this object.boolean
removePermission
(RepositoryPermission permission) Removes a single permission from the current set of permissions for this object.void
setPermissions
(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,false
otherwise.
-
findUserPermission
Returns the permission for the given user, if present, or an emptyOptional
otherwise.- Since:
- 2.38.0
-
findGroupPermission
Returns the permission for the given group, if present, or an emptyOptional
otherwise.- Since:
- 2.38.0
-