public class Roles
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static RolesCache |
cache |
Constructor and Description |
---|
Roles() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canLogin(RoleResource role)
Returns true if the supplied role has the login privilege.
|
static Role |
fromRoleResource(RoleResource resource,
IRoleManager roleManager)
Constructs a Role object from a RoleResource, using the methods of the supplied IRoleManager.
|
static java.util.Set<RoleResource> |
getAllRoles()
Enumerate all the roles in the system, preferably these will be fetched from the cache, which in turn
may have been warmed during startup.
|
static java.util.Map<java.lang.String,java.lang.String> |
getOptions(RoleResource role)
Returns the map of custom options for the named role.
|
static java.util.Set<Role> |
getRoleDetails(RoleResource primaryRole)
Get detailed info on all the roles granted to the role identified by the supplied RoleResource.
|
static java.util.Set<RoleResource> |
getRoles(RoleResource primaryRole)
Identify all roles granted to the supplied Role, including both directly granted
and inherited roles.
|
static boolean |
hasSuperuserStatus(RoleResource role)
Returns true if the supplied role or any other role granted to it
(directly or indirectly) has superuser status.
|
static void |
init()
Use
AuthCacheService.initializeAndRegisterCaches() rather than calling this directly |
static boolean |
isNullRole(Role role)
Just a convenience method which compares a role instance with the null object version, indicating if the
return from some query/lookup method was a valid Role or indicates that the role does not exist.
|
static Role |
nullRole()
Return the NullObject Role instance which can be safely used to indicate no information is available
when querying for a specific named role.
|
public static final RolesCache cache
public static void init()
AuthCacheService.initializeAndRegisterCaches()
rather than calling this directlypublic static java.util.Set<RoleResource> getRoles(RoleResource primaryRole)
primaryRole
- the Rolepublic static java.util.Set<Role> getRoleDetails(RoleResource primaryRole)
primaryRole
- identifies the rolepublic static java.util.Set<RoleResource> getAllRoles()
public static boolean hasSuperuserStatus(RoleResource role)
role
- the primary rolepublic static boolean canLogin(RoleResource role)
role
- the role identifierpublic static java.util.Map<java.lang.String,java.lang.String> getOptions(RoleResource role)
role
- the role identifierpublic static Role nullRole()
public static boolean isNullRole(Role role)
role
- public static Role fromRoleResource(RoleResource resource, IRoleManager roleManager)
resource
- identifies the roleroleManager
- provides lookup functions to retrieve role infoCopyright © 2009- The Apache Software Foundation