Interface AttachmentService.Validator
-
- Enclosing interface:
- AttachmentService
public static interface AttachmentService.Validator
Provides methods for validating the actions on the AttachmentService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
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 contentValidationResult
validateDelete(Content attachment)
Validate that an Attachment can be deleted, including permission checks.
-
-
-
Method Detail
-
validateDelete
ValidationResult validateDelete(Content attachment)
Validate that an Attachment can be deleted, including permission checks.- Parameters:
attachment
- the attachment to be deleted- Returns:
- an immutable Validation result.
-
canCreateAttachments
boolean canCreateAttachments(ContentId containerId) throws NotFoundException
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
boolean canCreateAttachments(ContentId containerId, ContentStatus status) throws NotFoundException
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
-
-