Skip to content

Commit

Permalink
Designate reporting_user as a deprecated role (elastic#72057)
Browse files Browse the repository at this point in the history
* Designate reporting_user as a deprecated role

* fix compilation

Co-authored-by: Ioannis Kakavas <ioannis@elastic.co>
  • Loading branch information
tsullivan and jkakavas committed Apr 22, 2021
1 parent b3571be commit 7cc45ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,15 @@ private static Map<String, RoleDescriptor> initializeReservedRoles() {
.put("ingest_admin", new RoleDescriptor("ingest_admin", new String[] { "manage_index_templates", "manage_pipeline" },
null, null, MetadataUtils.DEFAULT_RESERVED_METADATA))
// reporting_user doesn't have any privileges in Elasticsearch, and Kibana authorizes privileges based on this role
.put("reporting_user", new RoleDescriptor("reporting_user", null, null,
null, MetadataUtils.DEFAULT_RESERVED_METADATA))
.put("reporting_user", new RoleDescriptor(
"reporting_user",
null,
null,
null,
null,
null,
MetadataUtils.getDeprecatedReservedMetadata("Please use Kibana feature privileges instead"),
null))
.put("kibana_dashboard_only_user", new RoleDescriptor(
"kibana_dashboard_only_user",
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,7 @@ public void testReportingUserRole() {
RoleDescriptor roleDescriptor = new ReservedRolesStore().roleDescriptor("reporting_user");
assertNotNull(roleDescriptor);
assertThat(roleDescriptor.getMetadata(), hasEntry("_reserved", true));
assertThat(roleDescriptor.getMetadata(), hasEntry("_deprecated", true));

Role reportingUserRole = Role.builder(roleDescriptor, null).build();
assertThat(reportingUserRole.cluster().check(ClusterHealthAction.NAME, request, authentication), is(false));
Expand Down

0 comments on commit 7cc45ee

Please sign in to comment.