public interface PermissionManagement<T,N,E extends AuthorizationException>
| Modifier and Type | Method and Description |
|---|---|
void |
addPermissionFilter(PermissionFilter<T,N> filter)
Adds a filter to the internal list of filters.
|
Set<Permission<T>> |
getPermissions(Long entityId)
Returns a collection of permissions for the given entity.
|
Set<Permission<T>> |
getPermissions(T entity)
Returns a collection of permissions for the given entity.
|
Set<Permission<T>> |
getPermissionsForCreation(N entity)
Returns a collection of permissions for creation for the given entity.
|
<R> R |
hasAndGetWithPermission(long entityId,
Permission<T> permission,
Converter<T,R> converter)
Checks the permission and returns the given entity converted with the provided converter if
the current user has the requested permission.
|
boolean |
hasPermission(long entityId,
Permission<T> permission)
Checks if the current user has the permission of the given entity.
|
boolean |
hasPermission(long entityId,
String permissionIdentifier)
Checks if the current user has the permission of the given entity.
|
boolean |
hasPermissionForCreation(Permission<T> permission)
Checks if the current user has the permission to to create entities of the associated type
|
void |
removePermissionFilter(PermissionFilter<T,N> filter)
Removes a filter from the internal list of filters.
|
void addPermissionFilter(PermissionFilter<T,N> filter)
filter - The filter to add.Set<Permission<T>> getPermissions(Long entityId)
entityId - ID of the entitySet<Permission<T>> getPermissions(T entity)
entity - The entity.Set<Permission<T>> getPermissionsForCreation(N entity)
entity - The entity, can be TO or null to check in general<R> R hasAndGetWithPermission(long entityId,
Permission<T> permission,
Converter<T,R> converter)
throws E extends AuthorizationException,
NotFoundException
R - the target type of the conversionentityId - ID of the entitypermission - The permission the user must have.converter - the converter to convert the resultE - in case the current user doesn't have the given permission.NotFoundException - in case the entity does not existE extends AuthorizationExceptionboolean hasPermission(long entityId,
Permission<T> permission)
entityId - ID of the entitypermission - The permission to check.boolean hasPermission(long entityId,
String permissionIdentifier)
entityId - ID of the entitypermissionIdentifier - The permission to check.boolean hasPermissionForCreation(Permission<T> permission)
permission - The permission to check.void removePermissionFilter(PermissionFilter<T,N> filter)
filter - The filter to remove.Copyright © 2019 Communote team. All rights reserved.