Interface AttachmentValidator

All Known Implementing Classes:
DefaultAttachmentValidator

@PublicApi @ParametersAreNonnullByDefault public interface AttachmentValidator
Provides validation methods for attachments.
Since:
v6.4
  • Method Details

    • canCreateAttachments

      boolean canCreateAttachments(@Nullable ApplicationUser user, Issue issue, ErrorCollection errorCollection)
      Verifies if user may create attachment for given issue.
      Parameters:
      user - user who creates attachment
      issue - target issue
      errorCollection - error collections that will be filled in case of error
      Returns:
      true if user can create attachments
    • canCreateAttachments

      @ExperimentalApi boolean canCreateAttachments(@Nullable ApplicationUser user, @Nonnull Issue issue, @Nullable String nextStatusId, @Nonnull ErrorCollection errorCollection)
      Check if the given user has permission to add an attachment during a workflow transition to a step with given id. This checks if the user is able to add an attachment in either the origin status or the target status of the workflow transition.
      Parameters:
      user - user who creates attachment
      issue - issue before workflow transition described by actionDescriptor
      nextStatusId - the status the issue will be in after workflow transition; if null the logic is the same as in canCreateAttachments(ApplicationUser, Issue, ErrorCollection)
      errorCollection - error collections that will be filled in case of error
      Returns:
      true if user can create attachments in origin status or the status after transition
      Since:
      8.3
    • canCreateTemporaryAttachments

      boolean canCreateTemporaryAttachments(@Nullable ApplicationUser user, io.atlassian.fugue.Either<Issue,Project> issueOrProject, ErrorCollection errorCollection)
      Verifies if user may create temporary attachment for given issue or project (in case if the issue is being created).
      Parameters:
      user - user who creates temporary attachment
      issueOrProject - target issue or project (in case if the issue is being created)
      errorCollection - error collections that will be filled in case of error
      Returns:
      true if user can create temporary attachments