|
|
@@ -1109,6 +1109,27 @@ public class ReservedRolesStoreTests extends ESTestCase {
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(RolloverAction.NAME).test(indexAbstraction), is(true));
|
|
|
assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateSettingsAction.NAME).test(indexAbstraction), is(true));
|
|
|
});
|
|
|
+
|
|
|
+ // Example transform package
|
|
|
+ Arrays.asList("kibana_sample_data_ecommerce", "kibana_sample_data_ecommerce_transform" + randomInt()).forEach(indexName -> {
|
|
|
+ final IndexAbstraction indexAbstraction = mockIndexAbstraction(indexName);
|
|
|
+ // Allow search and indexing
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(SearchAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(GetAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(IndexAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(UpdateAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(BulkAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ // Allow create and delete index
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(CreateIndexAction.NAME).test(indexAbstraction), is(true));
|
|
|
+ assertThat(kibanaRole.indices().allowedIndicesMatcher(DeleteIndexAction.NAME).test(indexAbstraction), is(true));
|
|
|
+
|
|
|
+ // Implied by the overall view_index_metadata and monitor privilege
|
|
|
+ assertViewIndexMetadata(kibanaRole, indexName);
|
|
|
+ assertThat(
|
|
|
+ kibanaRole.indices().allowedIndicesMatcher("indices:monitor/" + randomAlphaOfLengthBetween(3, 8)).test(indexAbstraction),
|
|
|
+ is(true)
|
|
|
+ );
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
public void testKibanaAdminRole() {
|