Interface RoleAssignmentManagement


public interface RoleAssignmentManagement
Role assignments management.
  • Method Details

    • assignAsync

      default CompletableFuture<Void> assignAsync(String role, String toUser)
      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

      CompletableFuture<Void> assignAsync(Set<String> roles, Set<String> toUsers)
      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

      default CompletableFuture<Void> revokeAsync(String role, String fromUser)
      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

      CompletableFuture<Void> revokeAsync(Set<String> roles, Set<String> fromUsers)
      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

      CompletableFuture<Set<User>> usersByRoleAsync(String role)
      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

      CompletableFuture<Set<String>> usernamesByRoleAsync(String role)
      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

      CompletableFuture<Set<Role>> rolesByUserAsync(String user)
      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.