Package com.jgcomptech.tools.authc
Class UserRoleManager
- java.lang.Object
-
- com.jgcomptech.tools.authc.UserRoleManager
-
public final class UserRoleManager extends java.lang.ObjectManages all user account roles.- Since:
- 1.4.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classUserRoleManager.SystemUserRolesA List of the implemented system user roles.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExistingUserRole(UserRole role)Adds an existing role to the list.UserRolecreateUserRole(java.lang.String name)Creates a new role and adds it to the list.static UserRoleManagergetInstance()Returns the singleton instance of the UserRoleManager.UserRolegetUserRole(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.booleanremoveUserRole(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
-
-