Skip to content

Commit 22b2b76

Browse files
committed
Squashing the 2 commits into one:
FeatureFlags (for "skip non-explicit groups") A local mod that skips non-explicit groups when the corresponding flag is defined.
1 parent 86796a1 commit 22b2b76

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/main/java/edu/harvard/iq/dataverse/search/SolrSearchServiceBean.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,14 @@ private String getPermissionFilterQuery(DataverseRequest dataverseRequest, SolrQ
10481048
for (Group group : groups) {
10491049
String groupAlias = group.getAlias();
10501050
if (groupAlias != null && !groupAlias.isEmpty() && (!avoidJoin || !groupAlias.startsWith("builtIn"))) {
1051-
groupList.add(IndexServiceBean.getGroupPrefix() + groupAlias);
1051+
boolean skipThisGroup = false;
1052+
if (FeatureFlags.SKIP_NONEXPLICIT_GROUPS.enabled() && group.getGroupProvider() != null && !"explicit".equals(group.getGroupProvider().getGroupProviderAlias())) {
1053+
skipThisGroup = true;
1054+
logger.info("Skipping non-explicit group " + groupAlias);
1055+
}
1056+
if (!skipThisGroup) {
1057+
groupList.add(IndexServiceBean.getGroupPrefix() + groupAlias);
1058+
}
10521059
}
10531060
}
10541061

src/main/java/edu/harvard/iq/dataverse/settings/FeatureFlags.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public enum FeatureFlags {
120120
* @since Dataverse 6.3
121121
*/
122122
ADD_PUBLICOBJECT_SOLR_FIELD("add-publicobject-solr-field"),
123+
SKIP_NONEXPLICIT_GROUPS("skip-nonexplicit-groups"),
123124
/**
124125
* With this flag set, Dataverse will index the actual origin of harvested
125126
* metadata records, instead of the "Harvested" string in all cases.

0 commit comments

Comments
 (0)