ktmud commented on a change in pull request #13773:
URL: https://github.com/apache/superset/pull/13773#discussion_r607190697



##########
File path: superset/security/manager.py
##########
@@ -987,15 +989,28 @@ def raise_for_access(  # pylint: 
disable=too-many-arguments,too-many-branches
                 )
 
         if datasource or query_context or viz:
+            extra_jwt = None
             if query_context:
                 datasource = query_context.datasource
+                extra_jwt = query_context.extra_jwt
             elif viz:
                 datasource = viz.datasource
+                extra_jwt = viz.extra_jwt
 
             assert datasource
 
+            ds_allowed_in_dashboard = False
+            if feature_flag_manager.is_feature_enabled("DASHBOARD_RBAC"):
+                dashboard_data_context = 
dashboard_jwt_manager.parse_jwt(extra_jwt)
+
+                if dashboard_data_context:
+                    ds_allowed_in_dashboard = (
+                        datasource.id in dashboard_data_context.dataset_ids
+                    )
+
             if not (
-                self.can_access_schema(datasource)
+                ds_allowed_in_dashboard

Review comment:
       I'd say even your external clients may have people with different access 
levels. Maybe not now, but it's possible. 
   
   Sometimes you want a single dashboard for all audience because it's easier 
to navigate and easier to communicate---you can share the same short link to 
all users and executives don't have to jump between two dashboards just to see 
the more sensitive data. You may also have two duplicate dashboards with 80% of 
the content the same, but it'd gradually become difficult to maintain.




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to