public class GroupsToApplicationsSeatingHelper extends Object
|Constructor and Description|
|Modifier and Type||Method and Description|
Checks which application roles will be effectively accessible by user if he will be added to given roles.
Performs a lookup for applications which should be accessible in given directory assuming that someone is a member of mentioned groups.
public Map<ApplicationRole,Set<ApplicationUser>> rolesToBeAddedForSeatingCountPurpose(Set<ApplicationUser> users, Set<String> groupsToBeAdded)
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 checked
groupsToBeAdded- groups to be added
public 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 performed
roles- checked roles
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 performed
groupsNames- groups which should be checked
Copyright © 2002-2020 Atlassian. All Rights Reserved.