Interface AttachmentService.Validator

Enclosing interface:
AttachmentService

public static interface AttachmentService.Validator
Provides methods for validating the actions on the AttachmentService
  • Method Details

    • 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 to
      status - the status of the content, either current or draft
      Returns:
      true if the user can add attachments to the given content
      Throws:
      NotFoundException
    • canMoveAttachment

      boolean canMoveAttachment(ContentId attachmentId, ContentId containerId) throws NotFoundException
      Checks if the user is permitted to move attachments to the given content
      Parameters:
      attachmentId - the id of the attachment
      containerId - 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