public interface UserGroupMemberManagement
| Modifier and Type | Method and Description |
|---|---|
void |
addGroup(Long targetGroupId,
Long groupId)
Add a group to a group if it is not already contained.
|
void |
addUser(Long groupId,
Long userId)
Add a user to a group
|
void |
addUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Adds a user to an external group.
|
boolean |
containsEntityDirectly(Long groupId,
Long entityId)
Returns true if the group or user is a direct member of the group.
|
boolean |
containsUser(Long groupId,
Long userId)
Returns true if the user is a direct or indirect member of the group.
|
boolean |
containsUserDirectly(Long groupId,
Long userId)
Returns true if the user is a direct member of the group.
|
int |
countMembers(Long groupId)
Return the number of direct members of a group.
|
List<UserData> |
getUsersOfGroup(Long groupId)
Return all users who are direct members of a group.
|
Collection<Long> |
getUsersOfGroup(Long groupId,
String externalSystemId)
Return all IDs of users who are direct members of a given group.
|
void |
removeEntityFromGroup(Long groupId,
Long entityId)
This method removes an entity from a group.
|
void |
removeGroupFromAllExternalGroups(Long groupId,
Collection<Long> groupIdsToIgnore)
Remove an external group from all external groups of the same external system that contain
this group as a direct member.
|
void |
removeGroupFromAllGroups(Long groupId)
Remove a group from all groups it is a member of.
|
void |
removeUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Removes a user from an external group.
|
void |
removeUserFromAllGroups(Long userId) |
void addGroup(Long targetGroupId, Long groupId) throws GroupOperationNotPermittedException, GroupNotFoundException, CantAddParentAsChildException, AuthorizationException
targetGroupId - ID of the target group the other group should be added togroupId - ID of the group to addGroupOperationNotPermittedException - in case the target group is an external groupGroupNotFoundException - in case the target group or the group to add does not existCantAddParentAsChildException - in case adding the group would lead to a cyclic group hierarchyAuthorizationException - in case the current user is not client managervoid addUser(Long groupId, Long userId) throws GroupNotFoundException, UserNotFoundException, GroupOperationNotPermittedException, AuthorizationException
groupId - the ID of the group to add the user touserId - the ID of the user to addGroupNotFoundException - in case the group does not existUserNotFoundException - in case the user does not existGroupOperationNotPermittedException - in case the group is an external groupAuthorizationException - in case the current user is not client managervoid addUserForExternal(Long groupId, Long userId, String externalSystemId) throws GroupNotFoundException, UserNotFoundException, AuthorizationException
groupId - the ID of the external group to add the user touserId - the ID of the user to addexternalSystemId - the ID of the external system the group should belong toGroupNotFoundException - in case the group does not existUserNotFoundException - in case the user does not existGroupOperationNotPermittedException - in case the group is not a group from the external system identified by the
externalSystemIdAuthorizationException - in case the current user is not the internal system userboolean containsEntityDirectly(Long groupId, Long entityId) throws GroupNotFoundException
Returns true if the group or user is a direct member of the group.
GroupNotFoundExceptionboolean containsUser(Long groupId, Long userId) throws GroupNotFoundException
Returns true if the user is a direct or indirect member of the group.
GroupNotFoundExceptionboolean containsUserDirectly(Long groupId, Long userId) throws GroupNotFoundException
Returns true if the user is a direct member of the group.
GroupNotFoundExceptionint countMembers(Long groupId)
groupId - the ID of the group whose members should be countedList<UserData> getUsersOfGroup(Long groupId) throws GroupNotFoundException
groupId - Id of the group.GroupNotFoundException - in case the group does not existCollection<Long> getUsersOfGroup(Long groupId, String externalSystemId) throws GroupNotFoundException
groupId - Id of the group.externalSystemId - If set, only users of the given external system are considered.GroupNotFoundException - in case the group does not existvoid removeEntityFromGroup(Long groupId, Long entityId) throws GroupOperationNotPermittedException, GroupNotFoundException
This method removes an entity from a group.
void removeGroupFromAllExternalGroups(Long groupId, Collection<Long> groupIdsToIgnore) throws GroupNotFoundException, AuthorizationException
groupId - ID of the external group to remove from the other external groupsgroupIdsToIgnore - list of IDs of groups the group should not be removed from. Can be null.GroupNotFoundException - in case the group does not existAuthorizationException - in case the current user is not the internal system uservoid removeGroupFromAllGroups(Long groupId) throws GroupNotFoundException, AuthorizationException
groupId - The id of the group to removeGroupNotFoundException - in case the group does not existAuthorizationException - in case the current user is not client manager or the internal system uservoid removeUserForExternal(Long groupId, Long userId, String externalSystemId) throws AuthorizationException
groupId - the ID of the external groupuserId - the ID of the user to removeexternalSystemId - the ID of the external system the group originated fromAuthorizationException - in case the current user is not the internal system uservoid removeUserFromAllGroups(Long userId) throws UserNotFoundException
UserNotFoundExceptionCopyright © 2019 Communote team. All rights reserved.