EntityListItem
- @Service(value="userGroupMemberManagement") public class UserGroupMemberManagementImpl<EntityListItem> extends UserGroupMemberManagementBase
UserGroupMemberManagement
Constructor and Description |
---|
UserGroupMemberManagementImpl() |
Modifier and Type | Method and Description |
---|---|
int |
countMembers(Long groupId)
Return the number of 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.
|
protected void |
handleAddGroup(Long parentGroupId,
Long childGroupId)
Add a group to a group if it is not already contained.
|
protected void |
handleAddUser(Long groupId,
Long userId)
Performs the core logic for
UserGroupMemberManagementBase.addUser(Long, Long) |
protected void |
handleAddUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Performs the core logic for
UserGroupMemberManagementBase.addUserForExternal(Long, Long, String) |
protected boolean |
handleContainsEntityDirectly(Long groupId,
Long entityId)
Performs the core logic for
UserGroupMemberManagementBase.containsEntityDirectly(Long, Long) |
protected boolean |
handleContainsUser(Long groupId,
Long userId)
Performs the core logic for
UserGroupMemberManagementBase.containsUser(Long, Long) |
protected boolean |
handleContainsUserDirectly(Long groupId,
Long userId)
Performs the core logic for
UserGroupMemberManagementBase.containsUserDirectly(Long, Long) |
protected List<UserData> |
handleGetUsersOfGroup(Long groupId)
Performs the core logic for
UserGroupMemberManagementBase.getUsersOfGroup(Long) |
protected void |
handleRemoveEntityFromGroup(Long groupId,
Long entityId)
Performs the core logic for
UserGroupMemberManagementBase.removeEntityFromGroup(Long, Long) |
protected void |
handleRemoveGroupFromAllGroups(Long groupId)
Performs the core logic for
UserGroupMemberManagementBase.removeGroupFromAllGroups(Long) |
protected void |
handleRemoveUserForExternal(Long groupId,
Long userId,
String externalSystemId)
Performs the core logic for
UserGroupMemberManagementBase.removeUserForExternal(Long, Long, String) |
protected void |
handleRemoveUserFromAllGroups(Long userId)
Performs the core logic for
UserGroupMemberManagementBase.removeUserFromAllGroups(Long) |
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.
|
addGroup, addUser, addUserForExternal, containsEntityDirectly, containsUser, containsUserDirectly, getPrincipal, getUsersOfGroup, removeEntityFromGroup, removeGroupFromAllGroups, removeUserForExternal, removeUserFromAllGroups
@Transactional(readOnly=true) public int countMembers(Long groupId)
UserGroupMemberManagement
groupId
- the ID of the group whose members should be counted@Transactional(readOnly=true) public Collection<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 existprotected void handleAddGroup(Long parentGroupId, Long childGroupId) throws GroupNotFoundException, CantAddParentAsChildException, AuthorizationException, GroupOperationNotPermittedException
UserGroupMemberManagementBase
handleAddGroup
in class UserGroupMemberManagementBase
parentGroupId
- ID of the target group the other group should be added tochildGroupId
- ID of the group to addGroupNotFoundException
- in case the target group or the group to add does not existCantAddParentAsChildException
- in case adding the group would lead to a cyclic group hierarchyGroupOperationNotPermittedException
- in case the target group is an external groupAuthorizationException
- in case the current user is not client managerprotected void handleAddUser(Long groupId, Long userId) throws GroupNotFoundException, UserNotFoundException, AuthorizationException, GroupOperationNotPermittedException
UserGroupMemberManagementBase.addUser(Long, Long)
handleAddUser
in class UserGroupMemberManagementBase
AuthorizationException
- in case the current user is not client managerGroupNotFoundException
UserNotFoundException
GroupOperationNotPermittedException
protected void handleAddUserForExternal(Long groupId, Long userId, String externalSystemId) throws GroupNotFoundException, UserNotFoundException, AuthorizationException
UserGroupMemberManagementBase
UserGroupMemberManagementBase.addUserForExternal(Long, Long, String)
handleAddUserForExternal
in class UserGroupMemberManagementBase
GroupNotFoundException
UserNotFoundException
AuthorizationException
protected boolean handleContainsEntityDirectly(Long groupId, Long entityId) throws GroupNotFoundException
UserGroupMemberManagementBase.containsEntityDirectly(Long, Long)
handleContainsEntityDirectly
in class UserGroupMemberManagementBase
GroupNotFoundException
protected boolean handleContainsUser(Long groupId, Long userId) throws GroupNotFoundException
UserGroupMemberManagementBase.containsUser(Long, Long)
handleContainsUser
in class UserGroupMemberManagementBase
GroupNotFoundException
protected boolean handleContainsUserDirectly(Long groupId, Long userId) throws GroupNotFoundException
UserGroupMemberManagementBase.containsUserDirectly(Long, Long)
handleContainsUserDirectly
in class UserGroupMemberManagementBase
GroupNotFoundException
protected List<UserData> handleGetUsersOfGroup(Long groupId) throws GroupNotFoundException
UserGroupMemberManagementBase.getUsersOfGroup(Long)
handleGetUsersOfGroup
in class UserGroupMemberManagementBase
GroupNotFoundException
protected void handleRemoveEntityFromGroup(Long groupId, Long entityId) throws GroupNotFoundException, GroupOperationNotPermittedException
UserGroupMemberManagementBase.removeEntityFromGroup(Long, Long)
handleRemoveEntityFromGroup
in class UserGroupMemberManagementBase
GroupNotFoundException
- Exception.GroupOperationNotPermittedException
- Exception.protected void handleRemoveGroupFromAllGroups(Long groupId) throws GroupNotFoundException, AuthorizationException
UserGroupMemberManagementBase
UserGroupMemberManagementBase.removeGroupFromAllGroups(Long)
handleRemoveGroupFromAllGroups
in class UserGroupMemberManagementBase
AuthorizationException
GroupNotFoundException
protected void handleRemoveUserForExternal(Long groupId, Long userId, String externalSystemId) throws AuthorizationException
UserGroupMemberManagementBase
UserGroupMemberManagementBase.removeUserForExternal(Long, Long, String)
handleRemoveUserForExternal
in class UserGroupMemberManagementBase
AuthorizationException
protected void handleRemoveUserFromAllGroups(Long userId)
UserGroupMemberManagementBase.removeUserFromAllGroups(Long)
handleRemoveUserFromAllGroups
in class UserGroupMemberManagementBase
@Transactional public void removeGroupFromAllExternalGroups(Long groupId, Collection<Long> groupIdsToIgnore) throws GroupNotFoundException, AuthorizationException
UserGroupMemberManagement
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 userCopyright © 2019 Communote team. All rights reserved.