Skip to content

Commit

Permalink
Code restructuring
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Bandener <[email protected]>
  • Loading branch information
nibix committed Oct 30, 2024
1 parent ca66928 commit 45f40b8
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,13 @@ public boolean invoke(PrivilegesEvaluationContext context, final ActionListener<
doFilterLevelDls = false;
} else { // mode == Mode.ADAPTIVE
Mode modeByHeader = getDlsModeHeader();
dlsRestrictionMap = config.getDocumentPrivileges()
.getRestrictions(context, resolved.getAllIndicesResolved(clusterService, context.getIndexNameExpressionResolver()));

if (modeByHeader == Mode.FILTER_LEVEL) {
doFilterLevelDls = true;
log.debug("Doing filter-level DLS due to header");
dlsRestrictionMap = config.getDocumentPrivileges()
.getRestrictions(context, resolved.getAllIndicesResolved(clusterService, context.getIndexNameExpressionResolver()));
} else {
dlsRestrictionMap = config.getDocumentPrivileges()
.getRestrictions(context, resolved.getAllIndicesResolved(clusterService, context.getIndexNameExpressionResolver()));
doFilterLevelDls = dlsRestrictionMap.containsAny(DlsRestriction::containsTermLookupQuery);

if (doFilterLevelDls) {
Expand Down

0 comments on commit 45f40b8

Please sign in to comment.