@Internal public class CreateUserApplicationHelper extends Object implements UserApplicationHelper
Modifier and Type | Class and Description |
---|---|
static interface |
CreateUserApplicationHelper.ValidationFunction |
UserApplicationHelper.ApplicationSelection, UserApplicationHelper.ValidationScope
Constructor and Description |
---|
CreateUserApplicationHelper(ApplicationRoleManager applicationRoleManager,
I18nHelper i18nHelper,
BaseUrl baseUrl,
GlobalPermissionManager globalPermissionManager,
LicenseCountService licenseCountService,
FeatureManager featureManager,
JiraLicenseManager jiraLicenseManager,
GroupsToApplicationsSeatingHelper groupsToApplicationsSeatingHelper,
UserManager userManager,
com.atlassian.crowd.embedded.api.CrowdService crowdService,
GroupLabelsService groupLabels,
AuthorisationManager authorisationManager) |
Modifier and Type | Method and Description |
---|---|
boolean |
canUserLogin(ApplicationUser applicationUser)
Check if given user can login to JIRA.
|
List<UserApplicationHelper.ApplicationSelection> |
getApplicationsForSelection(Set<com.atlassian.application.api.ApplicationKey> selectedApplicationKeys,
Optional<Long> directoryId)
Return the
ApplicationSelection calculated from the current state of JIRA. |
List<UserApplicationHelper.ApplicationSelection> |
getApplicationsForUser(ApplicationUser user)
Return the
ApplicationSelection calculated from the current state of JIRA for given (@code ApplicationUser). |
Set<com.atlassian.crowd.embedded.api.Group> |
getDefaultGroupsForNewUser(Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
Get the default groups of the specified applications that should be used during user creation.
|
List<GroupView> |
getUserGroups(ApplicationUser applicationUser)
Return the list of
com.atlassian.jira.bc.user.GroupView connected with the given user. |
Collection<String> |
validateApplicationKeys(ApplicationUser user,
Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
Validates if adding a user with given application access to given applications won't exceed license limit
|
Collection<String> |
validateApplicationKeys(Optional<Long> directoryId,
Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
Validates if creating a user with given application access in given directory won't exceed license limit
|
Collection<String> |
validateApplicationKeys(Optional<Long> directoryId,
Set<com.atlassian.application.api.ApplicationKey> applicationKeys,
EnumSet<UserApplicationHelper.ValidationScope> validationScope)
Validates if creating a user with given application access in given directory won't cause issues defined in
UserApplicationHelper.ValidationScope |
Collection<String> |
validateDefaultApplications(EnumSet<UserApplicationHelper.ValidationScope> validationScope,
Optional<Long> directoryId)
Validates if creating a user with default application access in given directory won't exceed license limit
|
public CreateUserApplicationHelper(ApplicationRoleManager applicationRoleManager, I18nHelper i18nHelper, BaseUrl baseUrl, GlobalPermissionManager globalPermissionManager, LicenseCountService licenseCountService, FeatureManager featureManager, JiraLicenseManager jiraLicenseManager, GroupsToApplicationsSeatingHelper groupsToApplicationsSeatingHelper, UserManager userManager, com.atlassian.crowd.embedded.api.CrowdService crowdService, GroupLabelsService groupLabels, AuthorisationManager authorisationManager)
@Nonnull public List<UserApplicationHelper.ApplicationSelection> getApplicationsForSelection(@Nonnull Set<com.atlassian.application.api.ApplicationKey> selectedApplicationKeys, @Nonnull Optional<Long> directoryId)
UserApplicationHelper
ApplicationSelection
calculated from the current state of JIRA. The passed
applications are marked as selected (if they exist). The returned list will be ordered based on the Application
name except that JIRA Core will be returned last (if it exists).getApplicationsForSelection
in interface UserApplicationHelper
selectedApplicationKeys
- the set of application keys to mark as selected.directoryId
- optional directoryId to use for application selectionApplicationSelection
ordered by their name except that JIRA Core is always
last.@Nonnull public List<UserApplicationHelper.ApplicationSelection> getApplicationsForUser(@Nonnull ApplicationUser user)
UserApplicationHelper
ApplicationSelection
calculated from the current state of JIRA for given (@code ApplicationUser).getApplicationsForUser
in interface UserApplicationHelper
user
- subject application user to get applications for.ApplicationSelection
ordered by their name except that JIRA Core is always
last.@Nonnull public List<GroupView> getUserGroups(@Nonnull ApplicationUser applicationUser)
UserApplicationHelper
com.atlassian.jira.bc.user.GroupView
connected with the given user.
It respects nested groups.getUserGroups
in interface UserApplicationHelper
applicationUser
- the usercom.atlassian.jira.bc.user.GroupView
@Nonnull public Collection<String> validateDefaultApplications(EnumSet<UserApplicationHelper.ValidationScope> validationScope, Optional<Long> directoryId)
validateDefaultApplications
in interface UserApplicationHelper
directoryId
- the Directory ID, or Optional.empty()
if default directory should be checked@Nonnull public Collection<String> validateApplicationKeys(@Nonnull Optional<Long> directoryId, @Nonnull Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
validateApplicationKeys
in interface UserApplicationHelper
directoryId
- the Directory ID, or Optional.empty()
if default directory should be checkedapplicationKeys
- validated application keys@Nonnull public Collection<String> validateApplicationKeys(@Nonnull ApplicationUser user, @Nonnull Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
UserApplicationHelper
validateApplicationKeys
in interface UserApplicationHelper
user
- validated userapplicationKeys
- validated application keys@Nonnull public Collection<String> validateApplicationKeys(@Nonnull Optional<Long> directoryId, @Nonnull Set<com.atlassian.application.api.ApplicationKey> applicationKeys, @Nonnull EnumSet<UserApplicationHelper.ValidationScope> validationScope)
UserApplicationHelper
UserApplicationHelper.ValidationScope
validateApplicationKeys
in interface UserApplicationHelper
directoryId
- the Directory ID, or Optional.empty()
if default directory should be checkedapplicationKeys
- validated application keysvalidationScope
- required validation scopepublic boolean canUserLogin(@Nullable ApplicationUser applicationUser)
UserApplicationHelper
canUserLogin
in interface UserApplicationHelper
applicationUser
- given userpublic Set<com.atlassian.crowd.embedded.api.Group> getDefaultGroupsForNewUser(Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
This method is dark ages compatible (pre renaissance) in that if would return the 'JIRA Users' global permissions groups if the license permits a new user.
applicationKeys
- the keys that indicate what application access a user requires. This is ignored when in
dark ages mode (pre renaissance) ApplicationRoleManager#rolesEnabled()
.Copyright © 2002-2021 Atlassian. All Rights Reserved.