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.
-
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
-
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
-