Package com.jgcomptech.tools.authc
Class UserRoleManager
- java.lang.Object
-
- com.jgcomptech.tools.authc.UserRoleManager
-
public final class UserRoleManager extends java.lang.Object
Manages all user account roles.- Since:
- 1.4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UserRoleManager.SystemUserRoles
A List of the implemented system user roles.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExistingUserRole(UserRole role)
Adds an existing role to the list.UserRole
createUserRole(java.lang.String name)
Creates a new role and adds it to the list.static UserRoleManager
getInstance()
Returns the singleton instance of the UserRoleManager.UserRole
getUserRole(java.lang.String name)
Returns the specified user role.java.util.Map<java.lang.String,UserRole>
getUserRoles()
Returns a list of the current existing user roles.boolean
removeUserRole(java.lang.String name)
Removes the specified user role.
-
-
-
Method Detail
-
getInstance
public static UserRoleManager getInstance()
Returns the singleton instance of the UserRoleManager.- Returns:
- the singleton instance of the UserRoleManager
-
createUserRole
public UserRole createUserRole(java.lang.String name)
Creates a new role and adds it to the list.- Parameters:
name
- the name of the new role- Returns:
- the new role as a UserRole object
-
addExistingUserRole
public void addExistingUserRole(UserRole role)
Adds an existing role to the list.- Parameters:
role
- the role to be added
-
getUserRoles
public java.util.Map<java.lang.String,UserRole> getUserRoles()
Returns a list of the current existing user roles.- Returns:
- a list of the current existing user roles
-
getUserRole
public UserRole getUserRole(java.lang.String name)
Returns the specified user role.- Parameters:
name
- the name of the user role to return- Returns:
- the specified user role
-
removeUserRole
public boolean removeUserRole(java.lang.String name)
Removes the specified user role.- Parameters:
name
- the name of the user role to remove- Returns:
- true if no errors occurred
- Since:
- 1.5.1
-
-