Interface AttachmentService.Validator
- Enclosing interface:
- AttachmentService
public static interface AttachmentService.Validator
Provides methods for validating the actions on the AttachmentService
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canCreateAttachments
(ContentId containerId) Checks if the user is permitted to add attachments to the current version of the given contentboolean
canCreateAttachments
(ContentId containerId, ContentStatus status) Checks if the user is permitted to add attachments to the given contentboolean
canMoveAttachment
(ContentId attachmentId, ContentId containerId) Checks if the user is permitted to move attachments to the given contentvalidateDelete
(Content attachment) Validate that an Attachment can be deleted, including permission checks.
-
Method Details
-
validateDelete
Validate that an Attachment can be deleted, including permission checks.- Parameters:
attachment
- the attachment to be deleted- Returns:
- an immutable Validation result.
-
canCreateAttachments
Checks if the user is permitted to add attachments to the current version of the given content- Parameters:
containerId
- the id of the content to attach to- Returns:
- true if the user can add attachments to the given content
- Throws:
NotFoundException
-
canCreateAttachments
Checks if the user is permitted to add attachments to the given content- Parameters:
containerId
- the id of the content to attach tostatus
- the status of the content, either current or draft- Returns:
- true if the user can add attachments to the given content
- Throws:
NotFoundException
-
canMoveAttachment
Checks if the user is permitted to move attachments to the given content- Parameters:
attachmentId
- the id of the attachmentcontainerId
- the id of the content to attach to- Returns:
- true if the user can add attachments to the given content
- Throws:
NotFoundException
- Since:
- 8.9.0
-