@ParametersAreNonnullByDefault public class

ApplicationConfigurationHelper

extends Object
java.lang.Object
   ↳ com.atlassian.jira.application.ApplicationConfigurationHelper

Class Overview

Used to configure JIRA Applications (for example JIRA Software, JIRA Core, JIRA Service Desk) with default configurations such as default groups, default global permissions, admin access to applications and configuration of instance's default application; used during user creation.

Summary

Public Constructors
ApplicationConfigurationHelper(ApplicationManager applicationManager, GroupManager groupManager, ApplicationRoleManager applicationRoleManager, GlobalPermissionManager globalPermissionManager, UserManager userManager, ApplicationRoleStore applicationRoleStore, MessageUtil.Factory messageUtilFactory, GroupConfigurationIdentifier groupConfigurationIdentifier, EventPublisher eventPublisher, JiraAuthenticationContext authenticationContext, JiraLicenseManager jiraLicenseManager, JohnsonProvider johnsonProvider)
Public Methods
void configureApplicationsForImport(LicenseDetails licenseDetailsForImport)
Performs initial configuration for applications during JIRA Import.
void configureApplicationsForSetup(Collection<Group> additionalGroups, boolean publishEvent)
Performs initial configuration for applications during JIRA Setup.
void configureLicense(LicenseChangedEvent event)
void setupAdminForDefaultApplications(ApplicationUser user)
Configure the passed admin for all the default applications by adding the admin to all the applications default groups.
Optional<String> validateApplicationForConfiguration(ApplicationKey applicationKey, ApplicationUser user)
Validate whether the specified application can be configured.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ApplicationConfigurationHelper (ApplicationManager applicationManager, GroupManager groupManager, ApplicationRoleManager applicationRoleManager, GlobalPermissionManager globalPermissionManager, UserManager userManager, ApplicationRoleStore applicationRoleStore, MessageUtil.Factory messageUtilFactory, GroupConfigurationIdentifier groupConfigurationIdentifier, EventPublisher eventPublisher, JiraAuthenticationContext authenticationContext, JiraLicenseManager jiraLicenseManager, JohnsonProvider johnsonProvider)

Public Methods

public void configureApplicationsForImport (LicenseDetails licenseDetailsForImport)

Performs initial configuration for applications during JIRA Import. This action is performed anonymously as the user performing the import might no longer exist after import.

public void configureApplicationsForSetup (Collection<Group> additionalGroups, boolean publishEvent)

Performs initial configuration for applications during JIRA Setup.

  • Create the default group(s) for all the application role(s).
  • Add the additionalGroups to all the application role(s).
  • Grant all admin groups the default application global permissions

Parameters
additionalGroups Groups that will be added to all the licensed applications. They won't be added as defaults.
publishEvent If true then ApplicationConfigurationEvent will be published if there were any changes made by this method. This is especially handy during initial setup, where sending events might cause unwanted actions (like User Management sync)

public void configureLicense (LicenseChangedEvent event)

public void setupAdminForDefaultApplications (ApplicationUser user)

Configure the passed admin for all the default applications by adding the admin to all the applications default groups. This method is only useful if the applications in JIRA are configured with default groups.

Parameters
user the user to configure.

public Optional<String> validateApplicationForConfiguration (ApplicationKey applicationKey, ApplicationUser user)

Validate whether the specified application can be configured. This will also determine whether default group can be created by the provided user (or anonymously if no user has been provided).

Parameters
applicationKey key identifying application.
user user performing configuration or null if this is not being performed by a user.
Returns
  • an Optional with an warning message if validation did not pass or empty() if there are no warning.