You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "eschutho (via GitHub)" <gi...@apache.org> on 2023/07/27 16:06:48 UTC
[GitHub] [superset] eschutho commented on a diff in pull request #24789: fix: Dashboard aware RBAC dataset permission
eschutho commented on code in PR #24789:
URL: https://github.com/apache/superset/pull/24789#discussion_r1276507822
##########
superset/security/manager.py:
##########
@@ -1827,25 +1826,26 @@ def raise_for_access(
)
if datasource or query_context or viz:
+ form_data = None
+
if query_context:
datasource = query_context.datasource
+ form_data = query_context.form_data
elif viz:
datasource = viz.datasource
+ form_data = viz.form_data
assert datasource
- should_check_dashboard_access = (
- feature_flag_manager.is_feature_enabled("DASHBOARD_RBAC")
- or self.is_guest_user()
- )
-
if not (
self.can_access_schema(datasource)
or self.can_access("datasource_access", datasource.perm or "")
or self.is_owner(datasource)
or (
- should_check_dashboard_access
- and self.can_access_based_on_dashboard(datasource)
+ form_data
+ and (dashboard_id := form_data.get("dashboardId"))
+ and (dashboard := DashboardDAO.find_by_id(dashboard_id))
+ and self.can_access_dashboard(dashboard)
Review Comment:
I'm not too familiar with this feature either, but just noticed that the previous version checks for datasource access and the new one checks for dashboard access only. Is that what we want?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org