Interface RoleAssignmentManagement
public interface RoleAssignmentManagement
Role assignments management.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableFuture<Void>assignAsync(String role, String toUser) Assign role to user.assignAsync(Set<String> roles, Set<String> toUsers) Assign roles to users.default CompletableFuture<Void>revokeAsync(String role, String fromUser) Revoke role from user.revokeAsync(Set<String> roles, Set<String> fromUsers) Revoke roles from users.rolesByUserAsync(String user) Get all roles that are assigned to the specified user.Get all roles with associated users.usernamesByRoleAsync(String role) Get all usernames that are assigned with the specified role.usersByRoleAsync(String role) Get all users that are assigned with the specified role.Get all users with assigned roles.
-
Method Details
-
assignAsync
Assign role to user.- Parameters:
role- Role name.toUser- User name.- Returns:
- The future that will be completed when the operation is completed or failed with an exception.
-
assignAsync
Assign roles to users.- Parameters:
roles- Role names.toUsers- Usernames.- Returns:
- The future that will be completed when the operation is completed or failed with an exception.
-
revokeAsync
Revoke role from user.- Parameters:
role- Role name.fromUser- User name.- Returns:
- The future that will be completed when the operation is completed or failed with an exception.
-
revokeAsync
Revoke roles from users.- Parameters:
roles- Role names.fromUsers- Usernames.- Returns:
- The future that will be completed when the operation is completed or failed with an exception.
-
usersByRoleAsync
Get all users that are assigned with the specified role.- Parameters:
role- Role name.- Returns:
- The future that will be completed with the set of users or failed with an exception.
-
usernamesByRoleAsync
Get all usernames that are assigned with the specified role.- Parameters:
role- Role name.- Returns:
- The future that will be completed with the set of users or failed with an exception.
-
usersViewsAsync
CompletableFuture<Map<User,Set<Role>>> usersViewsAsync()Get all users with assigned roles. If no roles assigned user will be in result with empty Set.- Returns:
- The future that will be completed with the map of users or failed with an exception.
-
rolesViewsAsync
CompletableFuture<Set<RoleView>> rolesViewsAsync()Get all roles with associated users. If no users associated with the role then empty Set will be returned.- Returns:
- The future that will be completed with the map of roles or failed with an exception.
-
rolesByUserAsync
Get all roles that are assigned to the specified user.- Parameters:
user- User name.- Returns:
- The future that will be completed with the set of roles or failed with an exception.
-