Interface UserManagement

All Known Implementing Classes:
MockUserManagement

public interface UserManagement
Management of UserIds as members of Roles.
Author:
jonmv
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Ensures the given user exist, and are part of the given roles, or throws if the roles does not exist.
    void
    addUsers(Role role, Collection<UserId> users)
    Ensures the given users exist, and are part of the given role, or throws if the role does not exist.
    void
    Creates the given role, or throws if the role already exists.
    void
    Ensures the given role does not exist.
    Returns all roles
    Returns all roles of which the given user is part, or throws if the user does not exist
    Returns all users in the given role, or throws if the role does not exist.
    void
    Ensures the given users are not part of the given role, or throws if the roles does not exist.
    void
    Ensures none of the given users are part of the given role, or throws if the role does not exist.
  • Method Details

    • createRole

      void createRole(Role role)
      Creates the given role, or throws if the role already exists.
    • deleteRole

      void deleteRole(Role role)
      Ensures the given role does not exist.
    • addUsers

      void addUsers(Role role, Collection<UserId> users)
      Ensures the given users exist, and are part of the given role, or throws if the role does not exist.
    • addToRoles

      void addToRoles(UserId user, Collection<Role> roles)
      Ensures the given user exist, and are part of the given roles, or throws if the roles does not exist.
    • removeUsers

      void removeUsers(Role role, Collection<UserId> users)
      Ensures none of the given users are part of the given role, or throws if the role does not exist.
    • removeFromRoles

      void removeFromRoles(UserId user, Collection<Role> roles)
      Ensures the given users are not part of the given role, or throws if the roles does not exist.
    • listUsers

      List<User> listUsers(Role role)
      Returns all users in the given role, or throws if the role does not exist.
    • listRoles

      List<Role> listRoles(UserId user)
      Returns all roles of which the given user is part, or throws if the user does not exist
    • listRoles

      List<Role> listRoles()
      Returns all roles