public class GroupsToApplicationsSeatingHelper extends Object
Constructor and Description |
---|
GroupsToApplicationsSeatingHelper(ApplicationRoleManager applicationRoleManager,
GroupRelationshipChecker relationshipChecker) |
Modifier and Type | Method and Description |
---|---|
Set<ApplicationRole> |
findEffectiveApplications(Optional<Long> userDirectoryId,
Set<ApplicationRole> roles)
Checks which application roles will be effectively accessible by user if he will be added to given roles.
|
Set<ApplicationRole> |
findEffectiveApplicationsByGroups(Optional<Long> userDirectoryId,
Set<String> groupsNames)
Performs a lookup for applications which should be accessible in given directory assuming that someone is a member of mentioned groups.
|
Map<ApplicationRole,Set<ApplicationUser>> |
rolesToBeAddedForSeatingCountPurpose(Set<ApplicationUser> users,
Set<String> groupsToBeAdded)
Produces a relation between
ApplicationRole s and ApplicationUser s
indicating which users will gain access to which applications if they will be added to given groups. |
public GroupsToApplicationsSeatingHelper(ApplicationRoleManager applicationRoleManager, GroupRelationshipChecker relationshipChecker)
public Map<ApplicationRole,Set<ApplicationUser>> rolesToBeAddedForSeatingCountPurpose(Set<ApplicationUser> users, Set<String> groupsToBeAdded)
Produces a relation between ApplicationRole
s and ApplicationUser
s
indicating which users will gain access to which applications if they will be added to given groups.
This method is useful only in seating counting. There is one gotcha: if users are already (or eventually will be) added to some application, and we want to give them CORE access it's dry-run. We won't count them as jira-core users as it will be implied.
users
- users to be checkedgroupsToBeAdded
- groups to be addedpublic Set<ApplicationRole> findEffectiveApplications(Optional<Long> userDirectoryId, Set<ApplicationRole> roles)
findEffectiveApplicationsByGroups(java.util.Optional, java.util.Set)
for more detailed explanation.userDirectoryId
- directory, in which lookup is performedroles
- checked rolesfindEffectiveApplicationsByGroups(java.util.Optional, java.util.Set)
public Set<ApplicationRole> findEffectiveApplicationsByGroups(Optional<Long> userDirectoryId, Set<String> groupsNames)
Performs a lookup for applications which should be accessible in given directory assuming that someone is a member of mentioned groups. This method does not incorporate in any way roles which users may already have. It also does not check which roles have free seats.
Due to nested group support it's not trivial to check potential application access. Effectively, access may be gained by:
Notice: When userDirectoryId is Optional.empty()
, it's not possible to perform exact search due to possibility of differen configurations.
It is advised to not perform approximate lookups.
userDirectoryId
- directory, in which lookup is performed, when Optional.empty()
given, approximate search will be performedgroupsNames
- groups which should be checkedCopyright © 2002-2015 Atlassian. All Rights Reserved.