Class UserRoleManager


  • public final class UserRoleManager
    extends java.lang.Object
    Manages all user account roles.
    Since:
    1.4.0
    • 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