Skip to content

Commit

Permalink
Match action name
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Nov 27, 2024
1 parent 9de9c24 commit 1369726
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.opensearch.action.bulk.BulkItemRequest;
import org.opensearch.action.bulk.BulkShardRequest;
import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.update.UpdateAction;
import org.opensearch.action.update.UpdateRequest;
import org.opensearch.client.Client;
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
Expand Down Expand Up @@ -135,10 +136,6 @@ public DlsFlsValveImpl(
*/
@Override
public boolean invoke(PrivilegesEvaluationContext context, final ActionListener<?> listener) {
if (!context.getAction().startsWith("indices:")) {
return true;
}

DlsFlsProcessedConfig config = this.dlsFlsProcessedConfig.get();
ActionRequest request = context.getRequest();
IndexResolverReplacer.Resolved resolved = context.getResolvedRequest();
Expand Down Expand Up @@ -268,7 +265,7 @@ public boolean invoke(PrivilegesEvaluationContext context, final ActionListener<
}
}

if (request instanceof UpdateRequest) {
if (UpdateAction.NAME.equals(context.getAction())) {
listener.onFailure(new OpenSearchSecurityException("Update is not supported when FLS or DLS or Fieldmasking is activated"));
return false;
}
Expand Down

0 comments on commit 1369726

Please sign in to comment.