public interface GroupManager
Typically this will be used to supplement the functionality of a
UserDetailsManager
in situations where the organization of application granted
authorities into groups is preferred over a straight mapping of users to roles.
With this scenario, users are allocated to groups and take on the list of authorities which are assigned to the group, providing more flexible administration options.
Modifier and Type | Method and Description |
---|---|
void |
addGroupAuthority(java.lang.String groupName,
GrantedAuthority authority)
Assigns a new authority to a group.
|
void |
addUserToGroup(java.lang.String username,
java.lang.String group)
Makes a user a member of a particular group.
|
void |
createGroup(java.lang.String groupName,
java.util.List<GrantedAuthority> authorities)
Creates a new group with the specified list of authorities.
|
void |
deleteGroup(java.lang.String groupName)
Removes a group, including all members and authorities.
|
java.util.List<java.lang.String> |
findAllGroups()
Returns the names of all groups that this group manager controls.
|
java.util.List<GrantedAuthority> |
findGroupAuthorities(java.lang.String groupName)
Obtains the list of authorities which are assigned to a group.
|
java.util.List<java.lang.String> |
findUsersInGroup(java.lang.String groupName)
Locates the users who are members of a group
|
void |
removeGroupAuthority(java.lang.String groupName,
GrantedAuthority authority)
Deletes an authority from those assigned to a group
|
void |
removeUserFromGroup(java.lang.String username,
java.lang.String groupName)
Deletes a user's membership of a group.
|
void |
renameGroup(java.lang.String oldName,
java.lang.String newName)
Changes the name of a group without altering the assigned authorities or members.
|
java.util.List<java.lang.String> findAllGroups()
java.util.List<java.lang.String> findUsersInGroup(java.lang.String groupName)
groupName
- the group whose members are requiredvoid createGroup(java.lang.String groupName, java.util.List<GrantedAuthority> authorities)
groupName
- the name for the new groupauthorities
- the authorities which are to be allocated to this group.void deleteGroup(java.lang.String groupName)
groupName
- the group to remove.void renameGroup(java.lang.String oldName, java.lang.String newName)
void addUserToGroup(java.lang.String username, java.lang.String group)
username
- the user to be given membership.group
- the name of the group to which the user will be added.void removeUserFromGroup(java.lang.String username, java.lang.String groupName)
username
- the usergroupName
- the group to remove them fromjava.util.List<GrantedAuthority> findGroupAuthorities(java.lang.String groupName)
void addGroupAuthority(java.lang.String groupName, GrantedAuthority authority)
void removeGroupAuthority(java.lang.String groupName, GrantedAuthority authority)