Skip to content

Commit

Permalink
DLS/FLS fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Bandener <[email protected]>
  • Loading branch information
nibix committed Sep 16, 2024
1 parent bdfe2b5 commit d8aa346
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public boolean hasFieldMasking(String index) throws PrivilegesEvaluationExceptio
public boolean isFieldAllowed(String index, String field) throws PrivilegesEvaluationException {
PrivilegesEvaluationContext privilegesEvaluationContext = this.dlsFlsBaseContext.getPrivilegesEvaluationContext();
if (privilegesEvaluationContext == null) {
return false;
return true;
}

DlsFlsProcessedConfig config = this.dlsFlsProcessedConfig.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;
import java.util.Map;

import org.apache.logging.log4j.util.Strings;
import org.opensearch.cluster.metadata.IndexAbstraction;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.xcontent.json.JsonXContent;
Expand Down Expand Up @@ -57,7 +58,7 @@ static DlsQuery roleToRule(RoleV7.Index rolePermissions, NamedXContentRegistry x
throws PrivilegesConfigurationValidationException {
String dlsQueryTemplate = rolePermissions.getDls();

if (dlsQueryTemplate != null) {
if (dlsQueryTemplate != null && !Strings.isBlank(dlsQueryTemplate)) {
return DlsQuery.create(dlsQueryTemplate, xContentRegistry);
} else {
return null;
Expand Down

0 comments on commit d8aa346

Please sign in to comment.