public enum AAA extends Enum<AAA>
The facade to access osgl aaa security library functions
| Modifier and Type | Field and Description |
|---|---|
static org.osgl.logging.Logger |
logger |
static int |
SUPER_USER
The recommended super user privilege level
|
static String |
SYSTEM
The recommended name of system principal
|
static osgl.version.Version |
VERSION |
| Modifier and Type | Method and Description |
|---|---|
static Iterable<String> |
allPermissionNames()
Returns name of all
permissions |
static Iterable<Permission> |
allPermissions()
Returns all
permissions |
static Iterable<String> |
allPrivilegeNames()
Returns name of all
privileges |
static Iterable<Privilege> |
allPrivileges()
Returns all
privileges |
static Iterable<String> |
allRoleNames()
Returns name of all
roles |
static Iterable<Role> |
allRoles()
Returns all
roles |
static void |
clearContext()
Clear AAAContext thread local
|
static AAAContext |
context()
Return the
context from the current thread local |
static Principal |
createSuperUser()
Create a default super user principal with name “
su” |
static Principal |
createSuperUser(String userName)
Create a super user principal with name specified.
|
static Privilege |
findPrivilege(int level)
Get a
Privilege by level |
static boolean |
hasPermission(Enum<?> permissionEnum)
Check if current user has permission specified on target resource specified (implicitly)
|
static boolean |
hasPermission(Object guardedResource,
Enum<?> permissionEnum)
Check if current user has permission specified on target resource specified
|
static boolean |
hasPermission(Object guardedResource,
Enum<?> permissionEnum,
boolean allowSystem)
Check if the current principal has permission specified on the target object.
|
static boolean |
hasPermission(Object guardedResource,
Enum<?> permissionEnum,
boolean allowSystem,
AAAContext context)
Check if the current principal has permission specified by name on the target.
|
static boolean |
hasPermission(Object guardedResource,
Permission permission)
Check if current user has permission specified on target resource specified
|
static boolean |
hasPermission(Object guardedResource,
Permission permission,
boolean allowSystem)
Check if the current principal has permission specified on the target object.
|
static boolean |
hasPermission(Object guardedResource,
Permission permission,
boolean allowSystem,
AAAContext context)
Check if the current principal has permission specified on the guarded target resource.
|
static boolean |
hasPermission(Object guardedResource,
Principal principal,
Enum<?> permissionEnum)
Check if a user has permission specified on a target
|
static boolean |
hasPermission(Object guardedResource,
Principal principal,
Enum<?> permissionEnum,
AAAContext context)
Check if the specified principal has permission specified on the target resource.
|
static boolean |
hasPermission(Object guardedResource,
Principal principal,
Permission permission)
Check if a user has permission specified on a target
|
static boolean |
hasPermission(Object guardedResource,
Principal principal,
Permission permission,
AAAContext context)
Check if the principal specified has permission specified on the target.
|
static boolean |
hasPermission(Object guardedResource,
Principal principal,
String permissionName)
Check if a user has permission specified on a target
|
static boolean |
hasPermission(Object guardedResource,
Principal principal,
String permissionName,
AAAContext context)
Check if the specified principal has permission specified on the target resource.
|
static boolean |
hasPermission(Object guardedResource,
String permissionName)
Check if current user has permission specified on target resource specified
|
static boolean |
hasPermission(Object guardedResource,
String permissionName,
boolean allowSystem)
Check if the current principal has permission specified on the target object.
|
static boolean |
hasPermission(Object guardedResource,
String permissionName,
boolean allowSystem,
AAAContext context)
Check if the current principal has permission specified by name on the target.
|
static boolean |
hasPermission(Permission permission)
Check if current user has permission specified on target resource specified (implicitly)
|
static boolean |
hasPermission(String permissionName)
Check if current user has permission specified on target resource specified (implicitly)
|
static boolean |
hasPermissionOrPrivilege(Enum<?> permissionEnum,
Enum<?> privilegeEnum) |
static boolean |
hasPermissionOrPrivilege(Enum<?> permissionEnum,
Enum<?> privilegeEnum,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Enum<?> permissionEnum,
Enum<?> privilegeEnum,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Enum<?> permissionEnum,
int privilegeLevel) |
static boolean |
hasPermissionOrPrivilege(Enum<?> permissionEnum,
int privilegeLevel,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Enum<?> permissionEnum,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
boolean allowSystem) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel,
boolean allowSystem) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege,
boolean allowSystem) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Principal principal,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Principal principal,
Enum<?> permissionEnum,
int privilegeLevel,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Principal principal,
Permission permission,
Privilege privilege,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Principal principal,
String permissionName,
int privilegeLevel,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
Principal principal,
String permissionName,
String privilegeName,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel,
boolean allowSystem) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeName) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeName,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeName,
boolean allowSystem) |
static boolean |
hasPermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeName,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Permission permission,
Privilege privilege) |
static boolean |
hasPermissionOrPrivilege(Permission permission,
Privilege privilege,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(Permission permission,
Privilege privilege,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(String permissionName,
int privilegeLevel) |
static boolean |
hasPermissionOrPrivilege(String permissionName,
int privilegeLevel,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(String permissionName,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(String permissionName,
String privilegeName) |
static boolean |
hasPermissionOrPrivilege(String permissionName,
String privilegeName,
AAAContext context) |
static boolean |
hasPermissionOrPrivilege(String permissionName,
String privilegeName,
boolean allowSystem,
AAAContext context) |
static boolean |
hasPrivilege(Enum<?> privilegeEnum)
Check if the current principal has privilege required
|
static boolean |
hasPrivilege(Enum<?> privilegeEnum,
boolean allowSystem)
Check if the current principal has privilege required.
|
static boolean |
hasPrivilege(Enum<?> privilegeEnum,
boolean allowSystem,
AAAContext context)
Check if the current principal has privilege required.
|
static boolean |
hasPrivilege(int privilegeLevel)
Check if the current principal has privilege required
|
static boolean |
hasPrivilege(int privilegeLevel,
boolean allowSystem)
Check if the current principal has privilege required.
|
static boolean |
hasPrivilege(int privilegeLevel,
boolean allowSystem,
AAAContext context)
Check if the current principal has privilege required.
|
static boolean |
hasPrivilege(Principal principal,
Enum<?> privilegeEnum,
AAAContext context)
Check if the principal specified has privilege required.
|
static boolean |
hasPrivilege(Principal principal,
int privilegeLevel,
AAAContext context)
Check if the principal specified has privilege required.
|
static boolean |
hasPrivilege(Principal principal,
Privilege privilege,
AAAContext context)
Check if the principal specified has privilege required.
|
static boolean |
hasPrivilege(Principal principal,
String privilegeName,
AAAContext context)
Check if the principal specified has privilege required.
|
static boolean |
hasPrivilege(Privilege privilege)
Check if the current principal has privilege required
|
static boolean |
hasPrivilege(Privilege privilege,
boolean allowSystem)
Check if the current principal has privilege required.
|
static boolean |
hasPrivilege(Privilege privilege,
boolean allowSystem,
AAAContext context)
Check if the current principal has privilege required.
|
static boolean |
hasPrivilege(String privilegeName)
Check if the current principal has privilege required
|
static boolean |
hasPrivilege(String privilegeName,
boolean allowSystem)
Check if the current principal has privilege required.
|
static boolean |
hasPrivilege(String privilegeName,
boolean allowSystem,
AAAContext context)
Check if the current principal has privilege required.
|
static <T> void |
registerDynamicPermissionChecker(DynamicPermissionCheckHelper<T> checker,
Class<T> clz) |
static void |
requirePermission(Enum<?> permissionEnum)
Authorize by permission.
|
static void |
requirePermission(Enum<?> permissionEnum,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Enum<?> permissionEnum,
boolean allowSystem)
Authorize by permission.
|
static void |
requirePermission(Enum<?> permissionEnum,
boolean allowSystem,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Enum<?> permissionEnum)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Enum<?> permissionEnum,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Enum<?> permissionEnum,
boolean allowSystem)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Enum<?> permissionEnum,
boolean allowSystem,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Permission permission)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Permission permission,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Permission permission,
boolean allowSystem)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Permission permission,
boolean allowSystem,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Principal principal,
Enum<?> permissionEnum,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Principal principal,
Permission permission,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
Principal principal,
String permissionName,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
String permissionName)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
String permissionName,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
String permissionName,
boolean allowSystem)
Authorize by permission.
|
static void |
requirePermission(Object guardedResource,
String permissionName,
boolean allowSystem,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Permission permission)
Authorize by permission.
|
static void |
requirePermission(Permission permission,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(Permission permission,
boolean allowSystem)
Authorize by permission.
|
static void |
requirePermission(Permission permission,
boolean allowSystem,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(String permissionName)
Authorize by permission.
|
static void |
requirePermission(String permissionName,
AAAContext context)
Authorize by permission.
|
static void |
requirePermission(String permissionName,
boolean allowSystem)
Authorize by permission.
|
static void |
requirePermission(String permissionName,
boolean allowSystem,
AAAContext context)
Authorize by permission.
|
static void |
requirePermissionOrPrivilege(Enum<?> permissionEnum,
Enum<?> privilegeEnum) |
static void |
requirePermissionOrPrivilege(Enum<?> permissionEnum,
Enum<?> privilegeEnum,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Enum<?> permissionEnum,
Enum<?> privilegeEnum,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Enum<?> permissionEnum,
int privilegeLevel) |
static void |
requirePermissionOrPrivilege(Enum<?> permissionEnum,
int privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Enum<?> permissionEnum,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
boolean allowSystem) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel,
boolean allowSystem) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Enum<?> permissionEnum,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege,
boolean allowSystem) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Permission permission,
Privilege privilege,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Principal principal,
Enum<?> permissionEnum,
Enum<?> privilegeEnum,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Principal principal,
Enum<?> permissionEnum,
int privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Principal user,
Permission permission,
Privilege privilege,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Principal principal,
String permissionName,
int privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
Principal user,
String permissionName,
String privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel,
boolean allowSystem) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeLevel) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeLevel,
boolean allowSystem) |
static void |
requirePermissionOrPrivilege(Object guardedResource,
String permissionName,
String privilegeLevel,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Permission permission,
Privilege privilege) |
static void |
requirePermissionOrPrivilege(Permission permission,
Privilege privilege,
AAAContext context) |
static void |
requirePermissionOrPrivilege(Permission permission,
Privilege privilege,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(String permissionName,
int privilegeLevel) |
static void |
requirePermissionOrPrivilege(String permissionName,
int privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(String permissionName,
int privilegeLevel,
boolean allowSystem,
AAAContext context) |
static void |
requirePermissionOrPrivilege(String permissionName,
String privilegeLevel) |
static void |
requirePermissionOrPrivilege(String permissionName,
String privilegeLevel,
AAAContext context) |
static void |
requirePermissionOrPrivilege(String permissionName,
String privilegeLevel,
boolean allowSystem,
AAAContext context) |
static void |
requirePrivilege(Enum<?> privilegeEnum)
Authorize by privilege
|
static void |
requirePrivilege(Enum<?> privilegeEnum,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(Enum<?> privilegeEnum,
boolean allowSystem)
Authorize by privilege
|
static void |
requirePrivilege(Enum<?> privilegeEnum,
boolean allowSystem,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(int privilegeLevel)
Authorize by privilege
|
static void |
requirePrivilege(int privilegeLevel,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(int privilegeLevel,
boolean allowSystem)
Authorize by privilege
|
static void |
requirePrivilege(int privilegeLevel,
boolean allowSystem,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(Principal principal,
Enum<?> privilegeEnum,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(Principal principal,
int privilegeLevel,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(Principal principal,
Privilege privilege,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(Principal principal,
String privilegeName,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(Privilege privilege)
Authorize by privilege
|
static void |
requirePrivilege(Privilege privilege,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(Privilege privilege,
boolean allowSystem)
Authorize by privilege
|
static void |
requirePrivilege(Privilege privilege,
boolean allowSystem,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(String privilegeName)
Authorize by privilege
|
static void |
requirePrivilege(String privilegeName,
AAAContext context)
Authorize by privilege
|
static void |
requirePrivilege(String privilegeName,
boolean allowSystem)
Authorize by privilege
|
static void |
requirePrivilege(String privilegeName,
boolean allowSystem,
AAAContext context)
Authorize by privilege
|
static void |
setContext(AAAContext context)
Set AAAContext to thread local
|
static void |
setDefaultContext(AAAContext context) |
static AAA |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AAA[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final osgl.version.Version VERSION
public static final org.osgl.logging.Logger logger
public static final String SYSTEM
The recommended name of system principal
public static final int SUPER_USER
The recommended super user privilege level
public static AAA[] values()
for (AAA c : AAA.values()) System.out.println(c);
public static AAA valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static void setDefaultContext(AAAContext context)
public static void setContext(AAAContext context)
Set AAAContext to thread local
context - the context to be set to ThreadLocalpublic static void clearContext()
Clear AAAContext thread local
public static AAAContext context()
Return the context from the current thread local
public static <T> void registerDynamicPermissionChecker(DynamicPermissionCheckHelper<T> checker, Class<T> clz)
public static boolean hasPermission(Permission permission)
Check if current user has permission specified on target resource specified (implicitly)
This will call hasPermission(Object, Permission) with null passed in as the guarded target
permission - the permission requiredtrue if the current principal has the permission on the target resourcepublic static boolean hasPermission(String permissionName)
Check if current user has permission specified on target resource specified (implicitly)
This will call hasPermission(Object, String) with null passed in as the guarded resource
permissionName - the name of the permission requiredtrue if the current principal has the permission on the target resourcepublic static boolean hasPermission(Enum<?> permissionEnum)
Check if current user has permission specified on target resource specified (implicitly)
This will call hasPermission(Object, String) with null passed in as the guarded resource
permissionEnum - enum that provides the name of the permission requiredtrue if the current principal has the permission on the target resourcepublic static boolean hasPermission(Object guardedResource, Permission permission)
Check if current user has permission specified on target resource specified
This will call hasPermission(Object, Permission, boolean) with true as allowSystem flag
guardedResource - the guarded resourcepermission - the permission requiredtrue if the current principal has the permission on the target resourcepublic static boolean hasPermission(Object guardedResource, String permissionName)
Check if current user has permission specified on target resource specified
This will call hasPermission(Object, String, boolean) with true as allowSystem flag
guardedResource - the guarded resourcepermissionName - the name of the permission requiredtrue if the current principal has the permission on the target resourcepublic static boolean hasPermission(Object guardedResource, Enum<?> permissionEnum)
Check if current user has permission specified on target resource specified
This will call hasPermission(Object, String, boolean) with true as allowSystem flag
guardedResource - the guarded resourcepermissionEnum - enum that provides the name of the permission requiredtrue if the current principal has the permission on the target resourcepublic static boolean hasPermission(Object guardedResource, Principal principal, Permission permission)
Check if a user has permission specified on a target
This method will call hasPermission(Object, Principal, Permission, AAAContext) and pass null as context parameter
guardedResource - the guarded objectprincipal - the user principalpermission - the permission requiredtrue if the user has the permission on the target or false otherwisepublic static boolean hasPermission(Object guardedResource, Principal principal, String permissionName)
Check if a user has permission specified on a target
This method will call hasPermission(Object, Principal, String, AAAContext) and pass null as context parameter
guardedResource - the guarded resourceprincipal - the user principalpermissionName - the name of the permission requiredtrue if the principal has permission on the guarded resourcepublic static boolean hasPermission(Object guardedResource, Principal principal, Enum<?> permissionEnum)
Check if a user has permission specified on a target
This method will call hasPermission(Object, Principal, String, AAAContext) and pass null as context parameter
guardedResource - the guarded resourceprincipal - the user principalpermissionEnum - the enum that provides the name of the permission requiredtrue if the principal has permission on the guarded resourcepublic static boolean hasPermission(Object guardedResource, Permission permission, boolean allowSystem)
Check if the current principal has permission specified on the target object.
This will call hasPermission(Object, Permission, boolean, AAAContext) and pass in the null as context
guardedResource - the guarded resourcepermission - the permission requiredallowSystem - if system principal is allowed in this contexttrue if the current principal has permission to the target objectpublic static boolean hasPermission(Object guardedResource, String permissionName, boolean allowSystem)
Check if the current principal has permission specified on the target object.
This will call hasPermission(Object, String, boolean, AAAContext) and pass in the null as context
guardedResource - the guarded objectpermissionName - the name of the permission requiredallowSystem - if system principal is allowed in this contexttrue if the current principal has permission to the target objectpublic static boolean hasPermission(Object guardedResource, Enum<?> permissionEnum, boolean allowSystem)
Check if the current principal has permission specified on the target object.
This will call hasPermission(Object, String, boolean, AAAContext) and pass in the null as context
guardedResource - the guarded objectpermissionEnum - the enum that provides the name of the permission requiredallowSystem - if system principal is allowed in this contexttrue if the current principal has permission to the target objectpublic static boolean hasPermission(Object guardedResource, Permission permission, boolean allowSystem, AAAContext context)
Check if the current principal has permission specified on the guarded target resource.
The logic of this method is
context = ensureContext(context);
Principal principal = context.getPrincipal(allowSystem);
return hasPermission(guardedResource, principal, permission, context);
guardedResource - the guarded targetpermission - the permission requiredallowSystem - specify if system principal is allowed in the contextcontext - the contexttrue if the current principal has the permissionpublic static boolean hasPermission(Object guardedResource, String permissionName, boolean allowSystem, AAAContext context)
Check if the current principal has permission specified by name on the target.
The logic of this method is
context = ensureContext(context);
Principal principal = context.getPrincipal(allowSystem);
return hasPermission(guardedResource, principal, permissionName, context);
guardedResource - the guarded targetpermissionName - the name of the permission requiredallowSystem - specify if system principal is allowed in the contextcontext - the contexttrue if the current principal has the permissionpublic static boolean hasPermission(Object guardedResource, Enum<?> permissionEnum, boolean allowSystem, AAAContext context)
Check if the current principal has permission specified by name on the target.
The logic of this method is
context = ensureContext(context);
Principal principal = context.getPrincipal(allowSystem);
return hasPermission(guardedResource, principal, permissionEnum.name(), context);
guardedResource - the guarded targetpermissionEnum - the enum that provides the name of the permission requiredallowSystem - specify if system principal is allowed in the contextcontext - the contexttrue if the current principal has the permissionpublic static boolean hasPermission(Object guardedResource, Principal principal, Permission permission, AAAContext context)
Check if the principal specified has permission specified on the target.
Note this method will sanitize on the passed in argument:
null passed in then it will tried to get the thread local context via context() methodnull passed in then it will tried to get it from context instancenull passed in then it will tried to get one from the context instanceguardedResource - the guarded targetprincipal - the principalpermission - the permission requiredcontext - the contexttrue if the current principal has the permissionAAAContext.getGuardedTarget(),
AAAContext.getCurrentPrincipal()public static boolean hasPermission(Object guardedResource, Principal principal, String permissionName, AAAContext context)
Check if the specified principal has permission specified on the target resource.
This method will find out the permission instance from the permissionName specified and then call hasPermission(Object, Principal, Permission, AAAContext) API with the permission found. If the permission not found by name then this method will return false directly
guardedResource - the guarded resourceprincipal - the principalpermissionName - the name of the permission requiredcontext - the contexttrue if the specified user has the permissionpublic static boolean hasPermission(Object guardedResource, Principal principal, Enum<?> permissionEnum, AAAContext context)
Check if the specified principal has permission specified on the target resource.
guardedResource - the guarded resourceprincipal - the principalpermissionEnum - the enum that provides the name of the permission requiredcontext - the contexttrue if the specified user has the permissionhasPermission(Object, Principal, String, AAAContext)public static void requirePermission(Permission permission) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permission - the permission nameorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(String permissionName) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionName - the permission nameorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Enum<?> permissionEnum) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionEnum - the enum that provides the permission nameorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Permission permission, boolean allowSystem) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permission - the permissionallowSystem - if system principal is allowed in this contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(String permissionName, boolean allowSystem) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionName - the permission nameallowSystem - if system principal is allowed in this contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Enum<?> permissionEnum, boolean allowSystem) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionEnum - the enum that provides the permission nameallowSystem - if system principal is allowed in this contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Permission permission, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permission - the permission objectcontext - the AAAContextorg.osgl.exception.AccessDeniedException - when current user does not have permission against current targetpublic static void requirePermission(String permissionName, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionName - the permission namecontext - the contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Enum<?> permissionEnum, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionEnum - the enum that provides the permission namecontext - the contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Permission permission, boolean allowSystem, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permission - the permissionallowSystem - if system principal is allowed in this contextcontext - the aaa contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(String permissionName, boolean allowSystem, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionName - the permission nameallowSystem - if system principal is allowed in this contextcontext - the aaa contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Enum<?> permissionEnum, boolean allowSystem, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
permissionEnum - the enum that provides permission nameallowSystem - if system principal is allowed in this contextcontext - the aaa contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Permission permission) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermission - the permissionorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, String permissionName) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionName - the permission nameorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Enum<?> permissionEnum) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionEnum - the enum that provides the permission nameorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Permission permission, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermission - the permissioncontext - the AAA contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, String permissionName, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionName - the permission namecontext - the AAA contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Enum<?> permissionEnum, AAAContext context) throws org.osgl.exception.AccessDeniedException
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionEnum - the enum that provides the permission namecontext - the AAA contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Permission permission, boolean allowSystem)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermission - the permissionallowSystem - whether system principal is allowed to access the resourceorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, String permissionName, boolean allowSystem)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionName - the permission nameallowSystem - whether system principal is allowed to access the resourceorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Enum<?> permissionEnum, boolean allowSystem)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionEnum - the enum that provides the permission nameallowSystem - whether system principal is allowed to access the resourceorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Permission permission, boolean allowSystem, AAAContext context)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermission - the permissionallowSystem - whether system principal is allowed to access the resourcecontext - the AAA Contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, String permissionName, boolean allowSystem, AAAContext context)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionName - the permission nameallowSystem - whether system principal is allowed to access the resourcecontext - the AAA Contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Enum<?> permissionEnum, boolean allowSystem, AAAContext context)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectpermissionEnum - the enum that provides the permission nameallowSystem - whether system principal is allowed to access the resourcecontext - the AAA Contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Principal principal, Permission permission, AAAContext context)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectprincipal - the principalpermission - the permissioncontext - the AAA Contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Principal principal, String permissionName, AAAContext context)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectprincipal - the principalpermissionName - the name of the permission requiredcontext - the AAA Contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static void requirePermission(Object guardedResource, Principal principal, Enum<?> permissionEnum, AAAContext context)
Authorize by permission.
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
guardedResource - the guarded objectprincipal - the principalpermissionEnum - the enum that provides the name of the permission requiredcontext - the AAA Contextorg.osgl.exception.AccessDeniedException - if the principal does not have permission specified on the target objectpublic static boolean hasPrivilege(Privilege privilege)
Check if the current principal has privilege required
privilege - the privilege requiredtrue if the current principal has the privilegepublic static boolean hasPrivilege(String privilegeName)
Check if the current principal has privilege required
privilegeName - the name of the privilege requiredtrue if the current principal has the privilegepublic static boolean hasPrivilege(Enum<?> privilegeEnum)
Check if the current principal has privilege required
privilegeEnum - the enum that provides the name of the privilege requiredtrue if the current principal has the privilegepublic static boolean hasPrivilege(int privilegeLevel)
Check if the current principal has privilege required
privilegeLevel - the privilege level requiredtrue if the current principal has the privilegepublic static boolean hasPrivilege(Privilege privilege, boolean allowSystem)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilege - the privilege requiredallowSystem - should system user be used or not when there is no current principaltrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(String privilegeName, boolean allowSystem)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilegeName - the name of the privilege requiredallowSystem - should system user be used or not when there is no current principaltrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(Enum<?> privilegeEnum, boolean allowSystem)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilegeEnum - the enum that provides the name of the privilege requiredallowSystem - should system user be used or not when there is no current principaltrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(int privilegeLevel,
boolean allowSystem)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilegeLevel - the privilege level requiredallowSystem - should system user be used or not when there is no current principaltrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(Privilege privilege, boolean allowSystem, AAAContext context)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilege - the privilege requiredallowSystem - should system user be used or not when there is no current principalcontext - the AAAContext instancetrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(String privilegeName, boolean allowSystem, AAAContext context)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilegeName - the name of the privilege requiredallowSystem - should system user be used or not when there is no current principalcontext - the AAAContext instancetrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(Enum<?> privilegeEnum, boolean allowSystem, AAAContext context)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilegeEnum - the enum that provides the name of the privilege requiredallowSystem - should system user be used or not when there is no current principalcontext - the AAAContext instancetrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(int privilegeLevel,
boolean allowSystem,
AAAContext context)
Check if the current principal has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
privilegeLevel - the privilege level requiredallowSystem - should system user be used or not when there is no current principalcontext - the AAAContext instancetrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(Principal principal, Privilege privilege, AAAContext context)
Check if the principal specified has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
principal - the principal to be checkedprivilege - the privilege requiredcontext - the AAAContext instancetrue if the current principal or system user has privilege requiredpublic static boolean hasPrivilege(Principal principal, String privilegeName, AAAContext context)
Check if the principal specified has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
principal - the principal to be checkedprivilegeName - the name of the privilege requiredcontext - the AAAContext instancetrue if the principal or system user has privilege requiredpublic static boolean hasPrivilege(Principal principal, Enum<?> privilegeEnum, AAAContext context)
Check if the principal specified has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
principal - the principal to be checkedprivilegeEnum - the enum that provides the name of the privilege requiredcontext - the AAAContext instancetrue if the principal or system user has privilege requiredpublic static boolean hasPrivilege(Principal principal, int privilegeLevel, AAAContext context)
Check if the principal specified has privilege required. allowSystem flag is passed in to provide the option whether or not the system user should used if no current principal found.
principal - the principal to be checkedprivilegeLevel - the privilege level requiredcontext - the AAAContext instancetrue if the current principal or system user has privilege requiredpublic static void requirePrivilege(Privilege privilege)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilege - the privilege requiredhasPrivilege(Privilege)public static void requirePrivilege(Enum<?> privilegeEnum)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeEnum - the name of the privilege requiredhasPrivilege(Enum)public static void requirePrivilege(String privilegeName)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeName - the name of the privilege requiredhasPrivilege(String)public static void requirePrivilege(int privilegeLevel)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeLevel - the privilege level requiredhasPrivilege(Privilege)public static void requirePrivilege(Privilege privilege, boolean allowSystem)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilege - the privilege requiredallowSystem - whether or not it shall use system user when current principal is not presentedhasPrivilege(Privilege)public static void requirePrivilege(String privilegeName, boolean allowSystem)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeName - the name of the privilege requiredallowSystem - whether or not it shall use system user when current principal is not presentedhasPrivilege(Privilege)public static void requirePrivilege(Enum<?> privilegeEnum, boolean allowSystem)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeEnum - the enum that provides the name of the privilege requiredallowSystem - whether or not it shall use system user when current principal is not presentedhasPrivilege(Privilege)public static void requirePrivilege(int privilegeLevel,
boolean allowSystem)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeLevel - the privilege level requiredallowSystem - whether or not it shall use system user when current principal is not presentedhasPrivilege(Privilege)public static void requirePrivilege(Privilege privilege, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilege - the privilege requiredcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(String privilegeName, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeName - the name of the privilege requiredcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(Enum<?> privilegeEnum, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeEnum - the name of the privilege requiredcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(int privilegeLevel,
AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeLevel - the privilege level requiredcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(Privilege privilege, boolean allowSystem, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilege - the privilege requiredallowSystem - specify whether or not it shall use system user when current principal is not presentedcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(String privilegeName, boolean allowSystem, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeName - the name of the privilege requiredallowSystem - specify whether or not it shall use system user when current principal is not presentedcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(Enum<?> privilegeEnum, boolean allowSystem, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeEnum - the name of the privilege requiredallowSystem - specify whether or not it shall use system user when current principal is not presentedcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(int privilegeLevel,
boolean allowSystem,
AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
privilegeLevel - the privilege level requiredallowSystem - specify whether or not it shall use system user when current principal is not presentedcontext - the AAAContext instancehasPrivilege(Privilege)public static void requirePrivilege(Principal principal, Privilege privilege, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
principal - the principal to be authorizedprivilege - the privilege requiredcontext - the AAAContextpublic static void requirePrivilege(Principal principal, String privilegeName, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
principal - the principal to be authorizedprivilegeName - the name of the privilege requiredcontext - the AAAContextpublic static void requirePrivilege(Principal principal, Enum<?> privilegeEnum, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
principal - the principal to be authorizedprivilegeEnum - the enum that provides the privilege requiredcontext - the AAAContextpublic static void requirePrivilege(Principal principal, int privilegeLevel, AAAContext context)
Authorize by privilege
This method will audit the success or failure of the authorizing by calling Auditor.audit(Object, Principal, String, String, boolean, String), where the auditor is retrieved from AAAContext.getAuditor()
principal - the principal to be authorizedprivilegeLevel - the privilege level requiredcontext - the AAAContextpublic static boolean hasPermissionOrPrivilege(Permission permission, Privilege privilege)
public static boolean hasPermissionOrPrivilege(String permissionName, String privilegeName)
public static boolean hasPermissionOrPrivilege(String permissionName, int privilegeLevel)
public static boolean hasPermissionOrPrivilege(Enum<?> permissionEnum, Enum<?> privilegeEnum)
public static boolean hasPermissionOrPrivilege(Enum<?> permissionEnum, int privilegeLevel)
public static boolean hasPermissionOrPrivilege(Permission permission, Privilege privilege, AAAContext context)
public static boolean hasPermissionOrPrivilege(String permissionName, String privilegeName, AAAContext context)
public static boolean hasPermissionOrPrivilege(String permissionName, int privilegeLevel, AAAContext context)
public static boolean hasPermissionOrPrivilege(Enum<?> permissionEnum, Enum<?> privilegeEnum, AAAContext context)
public static boolean hasPermissionOrPrivilege(Enum<?> permissionEnum, int privilegeLevel, AAAContext context)
public static boolean hasPermissionOrPrivilege(Permission permission, Privilege privilege, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(String permissionName, String privilegeName, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(String permissionName, int privilegeLevel, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Enum<?> permissionEnum, Enum<?> privilegeEnum, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Enum<?> permissionEnum, int privilegeLevel, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeName)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeName, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege, boolean allowSystem)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeName, boolean allowSystem)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel, boolean allowSystem)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum, boolean allowSystem)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel, boolean allowSystem)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeName, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel, boolean allowSystem, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Principal principal, Permission permission, Privilege privilege, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Principal principal, String permissionName, String privilegeName, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Principal principal, String permissionName, int privilegeLevel, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Principal principal, Enum<?> permissionEnum, Enum<?> privilegeEnum, AAAContext context)
public static boolean hasPermissionOrPrivilege(Object guardedResource, Principal principal, Enum<?> permissionEnum, int privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Permission permission, Privilege privilege)
public static void requirePermissionOrPrivilege(String permissionName, String privilegeLevel)
public static void requirePermissionOrPrivilege(String permissionName, int privilegeLevel)
public static void requirePermissionOrPrivilege(Enum<?> permissionEnum, Enum<?> privilegeEnum)
public static void requirePermissionOrPrivilege(Enum<?> permissionEnum, int privilegeLevel)
public static void requirePermissionOrPrivilege(Permission permission, Privilege privilege, AAAContext context)
public static void requirePermissionOrPrivilege(String permissionName, String privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(String permissionName, int privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Enum<?> permissionEnum, Enum<?> privilegeEnum, AAAContext context)
public static void requirePermissionOrPrivilege(Enum<?> permissionEnum, int privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Permission permission, Privilege privilege, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(String permissionName, String privilegeLevel, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(String permissionName, int privilegeLevel, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Enum<?> permissionEnum, Enum<?> privilegeEnum, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Enum<?> permissionEnum, int privilegeLevel, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeLevel)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel)
public static void requirePermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege, boolean allowSystem)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeLevel, boolean allowSystem)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel, boolean allowSystem)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum, boolean allowSystem)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel, boolean allowSystem)
public static void requirePermissionOrPrivilege(Object guardedResource, Permission permission, Privilege privilege, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, String privilegeLevel, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, String permissionName, int privilegeLevel, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, Enum<?> privilegeEnum, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Enum<?> permissionEnum, int privilegeLevel, boolean allowSystem, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Principal user, Permission permission, Privilege privilege, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Principal user, String permissionName, String privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Principal principal, String permissionName, int privilegeLevel, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Principal principal, Enum<?> permissionEnum, Enum<?> privilegeEnum, AAAContext context)
public static void requirePermissionOrPrivilege(Object guardedResource, Principal principal, Enum<?> permissionEnum, int privilegeLevel, AAAContext context)
public static Principal createSuperUser()
Create a default super user principal with name “su”
public static Principal createSuperUser(String userName)
Create a super user principal with name specified. The super user will have the SUPER_USER privilege
userName - the usernamepublic static Privilege findPrivilege(int level)
Get a Privilege by level
level - the privilege levelpublic static Iterable<Privilege> allPrivileges()
Returns all privileges
Iterablepublic static Iterable<Permission> allPermissions()
Returns all permissions
Iterablepublic static Iterable<Role> allRoles()
Returns all roles
Iterablepublic static Iterable<String> allPrivilegeNames()
Returns name of all privileges
Iterablepublic static Iterable<String> allPermissionNames()
Returns name of all permissions
IterableCopyright © 2017–2020 OSGL (Open Source General Library). All rights reserved.