Interface UserManagement
-
- All Known Implementing Classes:
MockUserManagement
public interface UserManagement- Author:
- jonmv
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddToRoles(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.voidaddUsers(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.voidcreateRole(Role role)Creates the given role, or throws if the role already exists.voiddeleteRole(Role role)Ensures the given role does not exist.List<Role>listRoles()Returns all rolesList<Role>listRoles(UserId user)Returns all roles of which the given user is part, or throws if the user does not existList<User>listUsers(Role role)Returns all users in the given role, or throws if the role does not exist.voidremoveFromRoles(UserId user, Collection<Role> roles)Ensures the given users are not part of the given role, or throws if the roles does not exist.voidremoveUsers(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.
-
-
-
Method Detail
-
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
-
-