You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/04/30 22:05:25 UTC

[GitHub] [incubator-druid] jon-wei commented on a change in pull request #7579: Adjust required permissions for system schema

jon-wei commented on a change in pull request #7579: Adjust required permissions for system schema
URL: https://github.com/apache/incubator-druid/pull/7579#discussion_r279954654
 
 

 ##########
 File path: sql/src/main/java/org/apache/druid/sql/calcite/schema/SystemSchema.java
 ##########
 @@ -493,11 +493,30 @@ public TableType getJdbcTableType()
     @Override
     public Enumerable<Object[]> scan(DataContext root)
     {
+      final AuthenticationResult authenticationResult =
+          (AuthenticationResult) root.get(PlannerContext.DATA_CTX_AUTHENTICATION_RESULT);
+
+      final Access stateAccess = AuthorizationUtils.authorizeAllResourceActions(
+          authenticationResult,
+          Collections.singletonList(new ResourceAction(new Resource("STATE", ResourceType.STATE), Action.READ)),
+          authorizerMapper
+      );
+      if (!stateAccess.isAllowed()) {
+        throw new ForbiddenException("Insufficient permission to view servers :" + stateAccess);
 
 Review comment:
   Fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org