public String getKey() { return key.value(); }
@Override public String getDefaultGroup() { return key.value() + "-group"; }
@Override public String toString() { return value(); }
@Nonnull @Override public String getName() { return key.value(); }
@Override public String getName() { return String.format("%s-name", key.value()); }
@Override public String getDescription() { return String.format("%s-description", key.value()); }
public String summary() { return String.format("Changed access configuration of %s", key.value()); }
public static URI getManagementPageForRole(final ApplicationKey key, final boolean isOnDemand) { final String browserUrl = isOnDemand ? URL_USER_BROWSER_OD : URL_USER_BROWSER_BTF; return URI.create(String.format(browserUrl, key.value())); } }
/** * Returns true if the given application would be considered activated by the given license {@link Properties}. * * @param applicationKey key of the application. * @param licenseProperties Map of license properties. */ static boolean isApplicationActivated(@Nonnull ApplicationKey applicationKey, @Nonnull Properties licenseProperties) { return ENABLED.equals(licenseProperties.getProperty(JIRA_PRODUCT_NAMESPACE + applicationKey.value() + PRODUCT_SUFFIX, "false")); }
private void verifyUseAndAdminGroupsMigratedToApplicationGroups(Set<Group> loginGroups, ApplicationKey applicationKey, ApplicationRole resultingApp) { // get all the 6.x USE and ADMIN groups and verify they exist as groups in Roles. // -> loginGroups > role.groups - lost groups -> warning final Set<Group> droppedGroups = Sets.difference(loginGroups, resultingApp.groups()); if (!droppedGroups.isEmpty()) { log.warn("Following Use/Admin groups were not migrated as application group to " + applicationKey.value() + ": " + droppedGroups.stream().map(Group::getName).collect(joining(", "))); } }
private void verifyUseGroupsWithoutAdminMigratedToDefaultGroups(Set<Group> default6xGroups, ApplicationKey applicationKey, ApplicationRole resultingApp) { // get all the 6.x USE groups (minus admin) and verify they exist in all the application roles as default // -> default6xGroups > role.defaultGroups - lost groups -> warning final Set<Group> droppedDefaultGroups = Sets.difference(default6xGroups, resultingApp.defaultGroups()); if (!droppedDefaultGroups.isEmpty()) { log.warn("Following USE groups were not migrated as default to " + applicationKey.value() + ": " + droppedDefaultGroups.stream().map(Group::getName).collect(joining(", "))); } }
private List<String> getApplicationKeys(Set<ApplicationRole> applicationRoles) { List<String> applicationKeys = new ArrayList<>(); for (ApplicationRole applicationRole: applicationRoles) { applicationKeys.add(applicationRole.getKey().value().toLowerCase()); } Collections.sort(applicationKeys); return applicationKeys; }
@Override public Option<URI> getPostInstallURI() { return Option.some(URI.create(String.format(CREATE_CORE_USER_URL, ApplicationKeys.CORE.value()))); }
public SingleProductLicenseDetailsView add(ApplicationKey key) { final SingleProductLicenseDetailsView detailsView = Mockito.mock(SingleProductLicenseDetailsView.class); when(detailsView.getProductKey()).thenReturn(key.value()); detailsViewMap.put(key, detailsView); return detailsView; } }
private static String toStringKey(ApplicationKey key) { return CaseFolding.foldString(key.value()); }
private void put(final ApplicationKey applicationKey) { log.info("The application {} will be stored to the database as a default one.", applicationKey); db.createValue(DEFAULT_APPLICATION_ENTITY, FieldMap.build(Columns.ROLE_NAME, applicationKey.value())); }
public AffectedApplication(final ApplicationRole role) { this.name = role.getName(); this.key = role.getKey().value(); }
private String getDefaultGroupName(final ApplicationKey applicationKey) { return toGroupName(applicationManager.getApplication(applicationKey).map(Application::getDefaultGroup) .getOrElse((Supplier<String>) () -> String.format("%s-users", applicationKey.value()))); }
private <T> ServiceOutcome<T> generateNotFoundOutcomeFor(ApplicationKey key) { final String message = ctx.getI18nHelper().getText("application.role.service.role.does.not.exist", key.value()); return ServiceOutcomeImpl.error(message, ErrorCollection.Reason.NOT_FOUND); } }
public static ApplicationRoleSelectItem of(ApplicationRole role) { return new ApplicationRoleSelectItem(role.getKey().value(), role.getName()); }