public interface AccessControlled
The BasicItem
which is the root superclass of all
items provides an implementation that checks the role keys for
access permission. Subclasses may override that implementation to
also check for other things. For example, the OwnedItem
class checks the item's owner against the logged in user.
Modifier and Type | Method and Description |
---|---|
void |
checkPermission(Permission permission)
Check if the logged in user has the desired permission on
the item, otherwise throw an exception.
|
java.util.Set<Permission> |
getPermissions()
Get the logged in user's permissions on the item.
|
boolean |
hasPermission(Permission permission)
Check if the logged in user has the desired permission on
the item.
|
boolean hasPermission(Permission permission)
permission
- The permission to check if the user has.void checkPermission(Permission permission) throws PermissionDeniedException
permission
- Permission the user should have.PermissionDeniedException
- If the user doesn't have the
requested permissionjava.util.Set<Permission> getPermissions()