|
@@ -24,6 +24,7 @@ import org.elasticsearch.common.Strings;
|
|
import org.elasticsearch.common.collect.MapBuilder;
|
|
import org.elasticsearch.common.collect.MapBuilder;
|
|
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
|
|
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
|
|
import org.elasticsearch.xpack.core.ccr.action.UnfollowAction;
|
|
import org.elasticsearch.xpack.core.ccr.action.UnfollowAction;
|
|
|
|
+import org.elasticsearch.xpack.core.indexlifecycle.action.ExplainLifecycleAction;
|
|
import org.elasticsearch.xpack.core.security.support.Automatons;
|
|
import org.elasticsearch.xpack.core.security.support.Automatons;
|
|
|
|
|
|
import java.util.Arrays;
|
|
import java.util.Arrays;
|
|
@@ -57,9 +58,11 @@ public final class IndexPrivilege extends Privilege {
|
|
private static final Automaton DELETE_INDEX_AUTOMATON = patterns(DeleteIndexAction.NAME);
|
|
private static final Automaton DELETE_INDEX_AUTOMATON = patterns(DeleteIndexAction.NAME);
|
|
private static final Automaton VIEW_METADATA_AUTOMATON = patterns(GetAliasesAction.NAME, AliasesExistAction.NAME,
|
|
private static final Automaton VIEW_METADATA_AUTOMATON = patterns(GetAliasesAction.NAME, AliasesExistAction.NAME,
|
|
GetIndexAction.NAME, IndicesExistsAction.NAME, GetFieldMappingsAction.NAME + "*", GetMappingsAction.NAME,
|
|
GetIndexAction.NAME, IndicesExistsAction.NAME, GetFieldMappingsAction.NAME + "*", GetMappingsAction.NAME,
|
|
- ClusterSearchShardsAction.NAME, TypesExistsAction.NAME, ValidateQueryAction.NAME + "*", GetSettingsAction.NAME);
|
|
|
|
|
|
+ ClusterSearchShardsAction.NAME, TypesExistsAction.NAME, ValidateQueryAction.NAME + "*", GetSettingsAction.NAME,
|
|
|
|
+ ExplainLifecycleAction.NAME);
|
|
private static final Automaton MANAGE_FOLLOW_INDEX_AUTOMATON = patterns(PutFollowAction.NAME, UnfollowAction.NAME,
|
|
private static final Automaton MANAGE_FOLLOW_INDEX_AUTOMATON = patterns(PutFollowAction.NAME, UnfollowAction.NAME,
|
|
CloseIndexAction.NAME);
|
|
CloseIndexAction.NAME);
|
|
|
|
+ private static final Automaton MANAGE_ILM_AUTOMATON = patterns("indices:admin/ilm/*");
|
|
|
|
|
|
public static final IndexPrivilege NONE = new IndexPrivilege("none", Automatons.EMPTY);
|
|
public static final IndexPrivilege NONE = new IndexPrivilege("none", Automatons.EMPTY);
|
|
public static final IndexPrivilege ALL = new IndexPrivilege("all", ALL_AUTOMATON);
|
|
public static final IndexPrivilege ALL = new IndexPrivilege("all", ALL_AUTOMATON);
|
|
@@ -75,6 +78,7 @@ public final class IndexPrivilege extends Privilege {
|
|
public static final IndexPrivilege CREATE_INDEX = new IndexPrivilege("create_index", CREATE_INDEX_AUTOMATON);
|
|
public static final IndexPrivilege CREATE_INDEX = new IndexPrivilege("create_index", CREATE_INDEX_AUTOMATON);
|
|
public static final IndexPrivilege VIEW_METADATA = new IndexPrivilege("view_index_metadata", VIEW_METADATA_AUTOMATON);
|
|
public static final IndexPrivilege VIEW_METADATA = new IndexPrivilege("view_index_metadata", VIEW_METADATA_AUTOMATON);
|
|
public static final IndexPrivilege MANAGE_FOLLOW_INDEX = new IndexPrivilege("manage_follow_index", MANAGE_FOLLOW_INDEX_AUTOMATON);
|
|
public static final IndexPrivilege MANAGE_FOLLOW_INDEX = new IndexPrivilege("manage_follow_index", MANAGE_FOLLOW_INDEX_AUTOMATON);
|
|
|
|
+ public static final IndexPrivilege MANAGE_ILM = new IndexPrivilege("manage_ilm", MANAGE_ILM_AUTOMATON);
|
|
|
|
|
|
private static final Map<String, IndexPrivilege> VALUES = MapBuilder.<String, IndexPrivilege>newMapBuilder()
|
|
private static final Map<String, IndexPrivilege> VALUES = MapBuilder.<String, IndexPrivilege>newMapBuilder()
|
|
.put("none", NONE)
|
|
.put("none", NONE)
|
|
@@ -91,6 +95,7 @@ public final class IndexPrivilege extends Privilege {
|
|
.put("view_index_metadata", VIEW_METADATA)
|
|
.put("view_index_metadata", VIEW_METADATA)
|
|
.put("read_cross_cluster", READ_CROSS_CLUSTER)
|
|
.put("read_cross_cluster", READ_CROSS_CLUSTER)
|
|
.put("manage_follow_index", MANAGE_FOLLOW_INDEX)
|
|
.put("manage_follow_index", MANAGE_FOLLOW_INDEX)
|
|
|
|
+ .put("manage_ilm", MANAGE_ILM)
|
|
.immutableMap();
|
|
.immutableMap();
|
|
|
|
|
|
public static final Predicate<String> ACTION_MATCHER = ALL.predicate();
|
|
public static final Predicate<String> ACTION_MATCHER = ALL.predicate();
|