Skip to content

Commit

Permalink
Updates the cluster permission check function to include index_templa…
Browse files Browse the repository at this point in the history
…te permission type

Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Jun 14, 2022
1 parent 001d73f commit 786454c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ private Set<String> evaluateAdditionalIndexPermissions(final ActionRequest reque
public static boolean isClusterPerm(String action0) {
return ( action0.startsWith("cluster:")
|| action0.startsWith("indices:admin/template/")

|| action0.startsWith("indices:admin/index_template/")
|| action0.startsWith(SearchScrollAction.NAME)
|| (action0.equals(BulkAction.NAME))
|| (action0.equals(MultiGetAction.NAME))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import org.opensearch.action.admin.indices.datastream.CreateDataStreamAction;
import org.opensearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.opensearch.action.admin.indices.resolve.ResolveIndexAction;
import org.opensearch.action.admin.indices.template.put.PutComponentTemplateAction;
import org.opensearch.action.bulk.BulkRequest;
import org.opensearch.action.bulk.BulkShardRequest;
import org.opensearch.action.delete.DeleteRequest;
Expand Down Expand Up @@ -697,6 +698,8 @@ private boolean getOrReplaceAllIndices(final Object request, final IndicesProvid
//do nothing
} else if (request instanceof SearchScrollRequest) {
//do nothing
} else if (request instanceof PutComponentTemplateAction.Request) {
// do nothing
} else {
if (isDebugEnabled) {
log.debug(request.getClass() + " not supported (It is likely not a indices related request)");
Expand Down

0 comments on commit 786454c

Please sign in to comment.