Package com.atlassian.jira.bc.user
Interface UserApplicationHelper
- All Known Implementing Classes:
CreateUserApplicationHelper
@Internal
public interface UserApplicationHelper
- Since:
- v7.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic enumWhat should be the validation scope, all type of problems or just the seat count -
Method Summary
Modifier and TypeMethodDescriptionbooleancanUserLogin(ApplicationUser applicationUser) Check if given user can login to JIRA.getApplicationsForSelection(Set<com.atlassian.application.api.ApplicationKey> selectedApplicationKeys, Optional<Long> directoryId) Return theApplicationSelectioncalculated from the current state of JIRA.Return theApplicationSelectioncalculated from the current state of JIRA for given (@code ApplicationUser).getUserGroups(ApplicationUser applicationUser) Return the list ofcom.atlassian.jira.bc.user.GroupViewconnected with the given user.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 limitvalidateApplicationKeys(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 limitvalidateApplicationKeys(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 inUserApplicationHelper.ValidationScopevalidateDefaultApplications(EnumSet<UserApplicationHelper.ValidationScope> validationScope, Optional<Long> directoryId) Validates if creating a user with default application access in given directory won't exceed license limit
-
Method Details
-
getApplicationsForSelection
@Nonnull List<UserApplicationHelper.ApplicationSelection> getApplicationsForSelection(@Nonnull Set<com.atlassian.application.api.ApplicationKey> selectedApplicationKeys, @Nonnull Optional<Long> directoryId) Return theApplicationSelectioncalculated 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
ApplicationSelectionordered by their name except that JIRA Core is always last.
-
getApplicationsForUser
@Nonnull List<UserApplicationHelper.ApplicationSelection> getApplicationsForUser(@Nonnull ApplicationUser user) Return theApplicationSelectioncalculated from the current state of JIRA for given (@code ApplicationUser).- Parameters:
user- subject application user to get applications for.- Returns:
- an immutable list of
ApplicationSelectionordered by their name except that JIRA Core is always last.
-
getUserGroups
Return the list ofcom.atlassian.jira.bc.user.GroupViewconnected 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, orOptional.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, orOptional.empty()if default directory should be checkedapplicationKeys- 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 inUserApplicationHelper.ValidationScope- Parameters:
directoryId- the Directory ID, orOptional.empty()if default directory should be checkedapplicationKeys- validated application keysvalidationScope- 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 userapplicationKeys- validated application keys- Returns:
- a collection of errors
-
canUserLogin
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
-