Interface UserApplicationHelper

All Known Implementing Classes:
CreateUserApplicationHelper

@Internal public interface UserApplicationHelper
Since:
v7.0
  • Method Details

    • getApplicationsForSelection

      @Nonnull List<UserApplicationHelper.ApplicationSelection> getApplicationsForSelection(@Nonnull Set<com.atlassian.application.api.ApplicationKey> selectedApplicationKeys, @Nonnull Optional<Long> directoryId)
      Return the 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).
      Parameters:
      selectedApplicationKeys - the set of application keys to mark as selected.
      directoryId - optional directoryId to use for application selection
      Returns:
      an immutable list of ApplicationSelection ordered by their name except that JIRA Core is always last.
    • getApplicationsForUser

      @Nonnull List<UserApplicationHelper.ApplicationSelection> getApplicationsForUser(@Nonnull ApplicationUser user)
      Return the ApplicationSelection calculated from the current state of JIRA for given (@code ApplicationUser).
      Parameters:
      user - subject application user to get applications for.
      Returns:
      an immutable list of ApplicationSelection ordered by their name except that JIRA Core is always last.
    • getUserGroups

      @Nonnull List<GroupView> getUserGroups(@Nonnull ApplicationUser applicationUser)
      Return the list of com.atlassian.jira.bc.user.GroupView connected with the given user. It respects nested groups.
      Parameters:
      applicationUser - the user
      Returns:
      an immutable list of com.atlassian.jira.bc.user.GroupView
    • validateDefaultApplications

      @Nonnull 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
      Parameters:
      directoryId - the Directory ID, or Optional.empty() if default directory should be checked
      Returns:
      a collection of errors
    • validateApplicationKeys

      @Nonnull Collection<String> validateApplicationKeys(@Nonnull Optional<Long> directoryId, @Nonnull Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
      Validates if creating a user with given application access in given directory won't exceed license limit
      Parameters:
      directoryId - the Directory ID, or Optional.empty() if default directory should be checked
      applicationKeys - validated application keys
      Returns:
      a collection of errors
    • validateApplicationKeys

      @Nonnull Collection<String> validateApplicationKeys(@Nonnull Optional<Long> directoryId, @Nonnull Set<com.atlassian.application.api.ApplicationKey> applicationKeys, @Nonnull EnumSet<UserApplicationHelper.ValidationScope> validationScope)
      Validates if creating a user with given application access in given directory won't cause issues defined in UserApplicationHelper.ValidationScope
      Parameters:
      directoryId - the Directory ID, or Optional.empty() if default directory should be checked
      applicationKeys - validated application keys
      validationScope - required validation scope
      Returns:
      a collection of errors
    • validateApplicationKeys

      @Nonnull Collection<String> validateApplicationKeys(@Nonnull ApplicationUser user, @Nonnull Set<com.atlassian.application.api.ApplicationKey> applicationKeys)
      Validates if adding a user with given application access to given applications won't exceed license limit
      Parameters:
      user - validated user
      applicationKeys - validated application keys
      Returns:
      a collection of errors
    • canUserLogin

      boolean canUserLogin(@Nullable ApplicationUser applicationUser)
      Check if given user can login to JIRA. Return true if user has any role or has admin/sysadmin privileges
      Parameters:
      applicationUser - given user
      Returns:
      true if user has any role or is an admin