Package com.atlassian.jira.issue
Interface AttachmentValidator
- All Known Implementing Classes:
DefaultAttachmentValidator
@PublicApi
@ParametersAreNonnullByDefault
public interface AttachmentValidator
Provides validation methods for attachments.
- Since:
- v6.4
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanCreateAttachments(ApplicationUser user, Issue issue, ErrorCollection errorCollection) Verifies if user may create attachment for given issue.booleancanCreateAttachments(ApplicationUser user, Issue issue, String nextStatusId, ErrorCollection errorCollection) Check if the given user has permission to add an attachment during a workflow transition to a step with given id.booleancanCreateTemporaryAttachments(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).
-
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 attachmentissue- target issueerrorCollection- 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 attachmentissue- issue before workflow transition described by actionDescriptornextStatusId- the status the issue will be in after workflow transition; if null the logic is the same as incanCreateAttachments(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 attachmentissueOrProject- 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
-