public class DefaultIdentityManager extends Object implements IdentityManager
Manager that provides user and group related information.
| Constructor and Description |
|---|
DefaultIdentityManager(UserManager userManager,
OneCurrentUserService currentUserService,
org.springframework.context.MessageSource messageSource) |
| Modifier and Type | Method and Description |
|---|---|
String |
getCurrentSystemAdminUserId()
Returns current tenant administrator user ID
|
String |
getSessionUserName()
Returns the display name of the current session user.
|
List<String> |
getUsersOfGroup(String groupId)
Returns all users for the given group id.
|
List<String> |
getUsersOfGroups(Collection<String> groupIds)
Returns all users for the given group ids.
|
boolean |
isUserInAllGroups(String userId,
Collection<String> groupIds)
Checks if the user with the given id is a member of all groups the collection.
|
boolean |
isUserInGroup(String userId,
String groupId)
Checks if the given user is a member of the group with the given id.
|
boolean |
isUserInGroups(String userId,
Collection<String> groupIds)
Checks if the user with the given id is a member of at least one group in the collection.
|
public DefaultIdentityManager(UserManager userManager, OneCurrentUserService currentUserService, org.springframework.context.MessageSource messageSource)
public List<String> getUsersOfGroup(String groupId)
IdentityManagerReturns all users for the given group id.
getUsersOfGroup in interface IdentityManagergroupId - the id of the grouppublic List<String> getUsersOfGroups(Collection<String> groupIds)
IdentityManagerReturns all users for the given group ids.
getUsersOfGroups in interface IdentityManagergroupIds - the ids of the groupspublic boolean isUserInGroup(String userId, String groupId)
IdentityManagerChecks if the given user is a member of the group with the given id.
isUserInGroup in interface IdentityManageruserId - the user id, not nullgroupId - the group id, not nullpublic boolean isUserInGroups(String userId, Collection<String> groupIds)
IdentityManagerChecks if the user with the given id is a member of at least one group in the collection.
isUserInGroups in interface IdentityManageruserId - the user id, not nullgroupIds - collection of group Ids, not nullpublic boolean isUserInAllGroups(String userId, Collection<String> groupIds)
IdentityManagerChecks if the user with the given id is a member of all groups the collection.
isUserInAllGroups in interface IdentityManageruserId - the user id, not nullgroupIds - collection of group Ids, not nullpublic String getSessionUserName()
IdentityManagerReturns the display name of the current session user. It also adds the information if the user is impersonated by another user. Example: If the user is not impersonated it will return: "Firstname Lastname", else it will return "Firstname1 Lastname1 on behalf of Firstname2 Lastname2".
getSessionUserName in interface IdentityManagerpublic String getCurrentSystemAdminUserId()
IdentityManagerReturns current tenant administrator user ID
getCurrentSystemAdminUserId in interface IdentityManagerCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.