Package com.priint.pubserverapi.role
Interface RoleServiceLocal
public interface RoleServiceLocal
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidassignToUsers(String roleName, List<String> logins) Assigns a role to multiple users, preserving their existing role memberships.default voidCreates a new roleCreates a newRoleQueryfor querying role information.default voidDeletes a role identified by its name.default voidDeletes multiple roles identified by their names.getRoleByName(String roleName) Retrieves aRoleby their name.default voidunassignFromUsers(String roleName, List<String> logins) Removes the specified memberships, preserving other roles of each user.default voidupdateRoleLabel(String roleName, String label) Updates only the label of an existing role.
-
Method Details
-
getRoleByName
Retrieves aRoleby their name.- Parameters:
roleName- the name of the role- Returns:
- an
Optionalcontaining theRoleif found, or an emptyOptionalif not - Throws:
UserServiceException- if an error occurs during retrievalRoleServiceException
-
createRoleQuery
RoleQuery createRoleQuery()Creates a newRoleQueryfor querying role information.- Returns:
- a new
RoleQueryinstance
-
updateRoleLabel
Updates only the label of an existing role. The name is an immutable identifier.- Throws:
RoleServiceException- if the role is missing or the arguments are invalid
-
unassignFromUsers
Removes the specified memberships, preserving other roles of each user. Duplicate, null and blank logins and missing memberships are ignored; an empty list is a no-op.- Throws:
RoleServiceException- if the role is missing or the list is null
-
create
Creates a new role- Parameters:
role- a role objectRole- Throws:
RoleServiceException- an exception if thrown
-
delete
Deletes a role identified by its name.- Parameters:
roleName- the name of the role to delete- Throws:
RoleServiceException- if an error occurs during deletion
-
delete
Deletes multiple roles identified by their names.- Parameters:
roleNames- the names of the roles to delete- Throws:
RoleServiceException- if an error occurs during deletion
-
assignToUsers
Assigns a role to multiple users, preserving their existing role memberships.- Parameters:
roleName- the name of the role to assignlogins- the login identifiers of the users- Throws:
RoleServiceException- if an error occurs during assignment
-