Package io.goobi.viewer.model.security
Class PagePermissions
java.lang.Object
io.goobi.viewer.model.security.PagePermissions
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPagePermissions(Map<Integer, AccessPermission> imagePermissions, Map<Integer, AccessPermission> thumbnailPermissions, Map<Integer, AccessPermission> zoomPermissions, Map<Integer, AccessPermission> downloadPermissions, Map<Integer, AccessPermission> fulltextPermissions, Map<Integer, AccessPermission> pdfPermissions) -
Method Summary
Modifier and TypeMethodDescriptiongetDownloadPermission(int order) getFulltextPermission(int order) getImagePermission(int order) getPdfPermission(int order) getThumbnailPermission(int order) getZoomPermission(int order) booleanisDownloadGranted(int order) booleanisEmpty()booleanisFulltextGranted(int order) booleanisImageGranted(int order) booleanisPdfGranted(int order) booleanisThumbnailGranted(int order) booleanisZoomGranted(int order)
-
Field Details
-
EMPTY
-
-
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_IMAGESaccess permissionthumbnailPermissions- map of page order →VIEW_THUMBNAILSaccess permissionzoomPermissions- map of page order →ZOOM_IMAGESaccess permissiondownloadPermissions- map of page order →DOWNLOAD_IMAGESaccess permissionfulltextPermissions- map of page order →VIEW_FULLTEXTaccess permissionpdfPermissions- map of page order →DOWNLOAD_PAGE_PDFaccess permission
-
-
Method Details
-
isEmpty
public boolean isEmpty()- Returns:
trueif this instance carries no pre-fetched data; callers must fall back to per-pagePhysicalElementchecks
-
isImageGranted
public boolean isImageGranted(int order) - Parameters:
order- physical page order number (Solr ORDER field)- Returns:
trueif image access is granted for the given order;falsefor unknown orders (fail-safe default)
-
isThumbnailGranted
public boolean isThumbnailGranted(int order) - Parameters:
order- physical page order number (Solr ORDER field)- Returns:
trueif thumbnail access is granted for the given order;falsefor unknown orders (fail-safe default)
-
isZoomGranted
public boolean isZoomGranted(int order) - Parameters:
order- physical page order number (Solr ORDER field)- Returns:
trueif zoom access is granted for the given order;falsefor unknown orders (fail-safe default)
-
isDownloadGranted
public boolean isDownloadGranted(int order) - Parameters:
order- physical page order number (Solr ORDER field)- Returns:
trueif download access is granted for the given order;falsefor unknown orders (fail-safe default)
-
isFulltextGranted
public boolean isFulltextGranted(int order) - Parameters:
order- physical page order number (Solr ORDER field)- Returns:
trueif fulltext access is granted for the given order;falsefor unknown orders (fail-safe default)
-
isPdfGranted
public boolean isPdfGranted(int order) - Parameters:
order- physical page order number (Solr ORDER field)- Returns:
trueif page-PDF download is granted for the given order;falsefor unknown orders (fail-safe default)
-
getImagePermission
- Parameters:
order- physical page order number- Returns:
- the stored image permission, or null if not prefetched
-
getThumbnailPermission
- Parameters:
order- physical page order number- Returns:
- the stored thumbnail permission, or null if not prefetched
-
getZoomPermission
- Parameters:
order- physical page order number- Returns:
- the stored zoom permission, or null if not prefetched
-
getDownloadPermission
- Parameters:
order- physical page order number- Returns:
- the stored download permission, or null if not prefetched
-
getFulltextPermission
- Parameters:
order- physical page order number- Returns:
- the stored fulltext permission, or null if not prefetched
-
getPdfPermission
- Parameters:
order- physical page order number- Returns:
- the stored PDF permission, or null if not prefetched
-