From 7063ecb01addd4d431b395b6db406184ea3e28b1 Mon Sep 17 00:00:00 2001 From: "Gantner, Florian Klaus" Date: Thu, 2 May 2024 14:46:53 +0200 Subject: [PATCH] consider security level in browse index plugins --- .../SolrServiceMetadataBrowseIndexingPlugin.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java index 7be7ecff450..68fbcfc285b 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceMetadataBrowseIndexingPlugin.java @@ -125,8 +125,20 @@ public void additionalIndex(Context context, IndexableObject indexableObject, So Boolean.FALSE), true); + // the maximum security level (if not null) which ist still indexed + Integer maxsecuritylevel = DSpaceServicesFactory + .getInstance() + .getConfigurationService() + .getIntProperty("discovery.index.securitylevel.maxlevel", 0); + + for (int x = 0; x < values.size(); x++) { MetadataValue val = values.get(x); + + if (val.getSecurityLevel() != null && val.getSecurityLevel() > maxsecuritylevel) { + continue; + } + boolean hasChoiceAuthority = choiceAuthorityService .isChoicesConfigured(metadataAuthorityService .makeFieldKey(val.getSchema(), val.getElement(), val.getQualifier())