P - Supported Permission typepublic interface Authorizer<P extends Permission>
Authentication authorization control using
permissions.| Modifier and Type | Method and Description |
|---|---|
static Authorizer<Permission> |
create()
Create a default Authorizer.
|
Class<? extends P> |
getPermissionType()
Get supported
Permission type |
boolean |
isPermitted(Authentication authentication,
Collection<P> permissions)
Check if given Authentication has all specified permission/s using a Collection
|
boolean |
isPermitted(Authentication authentication,
P... permissions)
Check if given Authentication has all specified permission/s
|
boolean |
isPermitted(Authentication authentication,
String... permissions)
Check if given Authentication has all specified permission/s using String permission form.
|
boolean |
isPermittedAny(Authentication authentication,
Collection<P> permissions)
Check if given Authentication has any of specified permission/s using a Collection
|
boolean |
isPermittedAny(Authentication authentication,
P... permissions)
Check if given Authentication has any of specified permission/s
|
boolean |
isPermittedAny(Authentication authentication,
String... permissions)
Check if given Authentication has any of specified permission/s using String permission form.
|
Class<? extends P> getPermissionType()
Permission typePermission typeboolean isPermitted(Authentication authentication, P... permissions)
authentication - Authentication subjectpermissions - Permissions to checktrue if given Authentication has all specified permissionboolean isPermitted(Authentication authentication, String... permissions)
String permission match against Authentication Permissions will be performed using
Permission.getPermission() method.
authentication - Authentication subjectpermissions - Permissions to checktrue if given Authentication has all specified permissionboolean isPermittedAny(Authentication authentication, P... permissions)
authentication - Authentication subjectpermissions - Permissions to checktrue if given Authentication has any of specified permissionboolean isPermittedAny(Authentication authentication, String... permissions)
String permission match against Authentication Permissions will be performed using
Permission.getPermission() method.
authentication - Authentication subjectpermissions - Permissions to checktrue if given Authentication has any of specified permissionboolean isPermitted(Authentication authentication, Collection<P> permissions)
authentication - Authentication subjectpermissions - Permissions to checktrue if given Authentication has all specified permissionboolean isPermittedAny(Authentication authentication, Collection<P> permissions)
authentication - Authentication subjectpermissions - Permissions to checktrue if given Authentication has any of specified permissionstatic Authorizer<Permission> create()
The default Authorizer never throws exceptions, adopting the following behaviour:
null Authentication is given, always returns falsenull or empty permissions are given, always returns falseAuthentication is not null and is root, always returns
truePermission.equals(Object) to compare a single permission to anotherDefaultAuthorizerCopyright © 2017 The Holon Platform. All rights reserved.