DASHBOARD_RBAC does not provide access to datasources used in DARSHBOARD_NATIVE_FILTERS

See original GitHub issue

The Dashboard RBAC functionality provides implicit access to datasources used for all charts on a dashboard, so that charts can retrieve underlying data even if user does not have explicit access to datasources. This does not cover Dashboard Native Filters correctly - in case native filter uses a datasource which is not used by any chart on the dashboard, the implicit access is not granted and the filter fails to load data.

How to reproduce the bug

  1. Create two datasources (A and B) that share a column name (“x”) and type, so that it is possible to use filter created on A to filter the B
  2. Create a chart using datasource B
  3. Create a dashboard and add the chart to it
  4. Add a native filter using datasource A and column “x”
  5. Save the dashboard and make it public
  6. Create a role with access rights enough to view dashboards, but with NO explicit access to datasources A and B, e.g. image
  7. Assign this role to the dashboard: image
  8. Create a new user account and grant the role to it
  9. Log in using this user account and access the dashboard

Expected results

The native filter is filled with data from datasource A.

Actual results

The native filter is stuck at “No data / Loading…” image

Screenshots

Included in reproduction procedure

Environment

  • browser type and version: Microsoft Edge 97.0.1072.69
  • superset version: 1.4.1
  • python version: python --version
  • node.js version: node -v
  • any feature flags active: DASHBOARD_RBAC, DASHBOARD_NATIVE_FILTERS (both are important for this bug)

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven’t found one similar.

Additional context

A HTTP403 response to “/api/v1/chart/data” is visible in network logs with the following content {"errors": [{"message": "This endpoint requires the datasource ..., database or\n all_datasource_access permission", "error_type": "DATASOURCE_SECURITY_ACCESS_ERROR", "level": "error", "extra": {"link": "", "datasource": "..."}}]} There is no problem if datasource A is used by any chart on dashboard, only if it is not used by any chart (used solely by the filter). There is no problem when using legacy filterboxes (because they are “charts” and thus the implicit access is granted?)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MM-Lehmanncommented, Apr 7, 2022

Also, may or may not be related: There is still a problem with dashboard_rbac when using a public dashboard for unauthenticated users. When logging in (oauth), no dashboards can be seen, that have not set their “dashboard roles” (rely on dataset access).

0reactions
MM-Lehmanncommented, Jun 8, 2022

look at #16718. related?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Restrict Data Access with User Filters and Row Level Security
Using this method, you create a calculated field that automates the process of mapping users to data values. This method requires that the...
Read more >
Security - Apache Superset
Security in Superset is handled by Flask AppBuilder (FAB), an application ... Alpha users have access to all data sources, but they cannot...
Read more >
Role-based Access Control (RBAC) - Preset Docs
This user role only has access to dashboards that are published, and is also subject to any defined data access role-based restrictions. For ......
Read more >
Restrict data access with row-level security (RLS) for Power BI ...
You can use row-level security (RLS) with Power BI Desktop to restrict data access for given users. Filters restrict data at the row...
Read more >
Granting individual Amazon QuickSight users and groups ...
Use the following procedure to grant access to a dashboard. ... They can view, filter, and sort the dashboard data. They can also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found