Class PagePermissions

java.lang.Object
io.goobi.viewer.model.security.PagePermissions

public final class PagePermissions extends Object
Immutable container for pre-fetched per-page access permissions for a single record.

Holds decisions for the six privilege types evaluated by AccessConditionUtils.fetchPagePermissions(String, jakarta.servlet.http.HttpServletRequest): VIEW_IMAGES, VIEW_THUMBNAILS, ZOOM_IMAGES, DOWNLOAD_IMAGES, VIEW_FULLTEXT, DOWNLOAD_PAGE_PDF. This covers every per-page isAccessPermission* method on PhysicalElement so that seeding covers the full viewer render path.

  • Field Details

  • Constructor Details

    • PagePermissions

      public PagePermissions(Map<Integer,AccessPermission> imagePermissions, Map<Integer,AccessPermission> thumbnailPermissions, Map<Integer,AccessPermission> zoomPermissions, Map<Integer,AccessPermission> downloadPermissions, Map<Integer,AccessPermission> fulltextPermissions, Map<Integer,AccessPermission> pdfPermissions)
      Parameters:
      imagePermissions - map of page order → VIEW_IMAGES access permission
      thumbnailPermissions - map of page order → VIEW_THUMBNAILS access permission
      zoomPermissions - map of page order → ZOOM_IMAGES access permission
      downloadPermissions - map of page order → DOWNLOAD_IMAGES access permission
      fulltextPermissions - map of page order → VIEW_FULLTEXT access permission
      pdfPermissions - map of page order → DOWNLOAD_PAGE_PDF access permission
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Returns:
      true if this instance carries no pre-fetched data; callers must fall back to per-page PhysicalElement checks
    • isImageGranted

      public boolean isImageGranted(int order)
      Parameters:
      order - physical page order number (Solr ORDER field)
      Returns:
      true if image access is granted for the given order; false for unknown orders (fail-safe default)
    • isThumbnailGranted

      public boolean isThumbnailGranted(int order)
      Parameters:
      order - physical page order number (Solr ORDER field)
      Returns:
      true if thumbnail access is granted for the given order; false for unknown orders (fail-safe default)
    • isZoomGranted

      public boolean isZoomGranted(int order)
      Parameters:
      order - physical page order number (Solr ORDER field)
      Returns:
      true if zoom access is granted for the given order; false for unknown orders (fail-safe default)
    • isDownloadGranted

      public boolean isDownloadGranted(int order)
      Parameters:
      order - physical page order number (Solr ORDER field)
      Returns:
      true if download access is granted for the given order; false for unknown orders (fail-safe default)
    • isFulltextGranted

      public boolean isFulltextGranted(int order)
      Parameters:
      order - physical page order number (Solr ORDER field)
      Returns:
      true if fulltext access is granted for the given order; false for unknown orders (fail-safe default)
    • isPdfGranted

      public boolean isPdfGranted(int order)
      Parameters:
      order - physical page order number (Solr ORDER field)
      Returns:
      true if page-PDF download is granted for the given order; false for unknown orders (fail-safe default)
    • getImagePermission

      public AccessPermission getImagePermission(int order)
      Parameters:
      order - physical page order number
      Returns:
      the stored image permission, or null if not prefetched
    • getThumbnailPermission

      public AccessPermission getThumbnailPermission(int order)
      Parameters:
      order - physical page order number
      Returns:
      the stored thumbnail permission, or null if not prefetched
    • getZoomPermission

      public AccessPermission getZoomPermission(int order)
      Parameters:
      order - physical page order number
      Returns:
      the stored zoom permission, or null if not prefetched
    • getDownloadPermission

      public AccessPermission getDownloadPermission(int order)
      Parameters:
      order - physical page order number
      Returns:
      the stored download permission, or null if not prefetched
    • getFulltextPermission

      public AccessPermission getFulltextPermission(int order)
      Parameters:
      order - physical page order number
      Returns:
      the stored fulltext permission, or null if not prefetched
    • getPdfPermission

      public AccessPermission getPdfPermission(int order)
      Parameters:
      order - physical page order number
      Returns:
      the stored PDF permission, or null if not prefetched