You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Mayeu (via GitHub)" <gi...@apache.org> on 2025/01/21 09:12:39 UTC
[I] DASHBOARD_RBAC doesn't work as intended, even with the example dataset [superset]
Mayeu opened a new issue, #31938:
URL: https://github.com/apache/superset/issues/31938
### Bug description
Hello 👋,
Activating the `DASHBOARD_RBAC` feature flag doesn't work as intended, we can't share access to our dashboard that way on our production instance, and it doesn't work locally either with the example dataset.
1. Checkout master (currently `63843c568255d5f1302815ed7614e93d7febadae`)
2. Activate the `DASHBOARD_RBAC` feature flag in `docker/pythonpath_dev/superset_config.py`
```python
FEATURE_FLAGS = {"ALERT_REPORTS": True, "DASHBOARD_RBAC": True}
```
4. Start the non-dev compose with: `docker compose -f docker-compose-non-dev.yml up --build`
5. Create a user, assign it the Gamma role <img width="1142" alt="Image" src="https://github.com/user-attachments/assets/aba46067-da9a-43fd-ab05-9b68c4d389b3" />
5. Open a dashboard, assign it the gamma role, save the dashboard
<img width="889" alt="Image" src="https://github.com/user-attachments/assets/f760abd6-837e-4ce7-b205-8defdbd89fd2" />
6. Open a private browser instance, log as the gamma user, open the dashboard, get an error (left gamma user, right admin user)
<img width="1918" alt="Image" src="https://github.com/user-attachments/assets/19b88fe4-a061-4351-8a03-46d1e5d968ba" />
Exception in the log:
```
superset_app | 2025-01-21 09:05:48,960:WARNING:superset.views.error_handling:SupersetErrorException
superset_app | Traceback (most recent call last):
superset_app | File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
superset_app | rv = self.dispatch_request()
superset_app | ^^^^^^^^^^^^^^^^^^^^^^^
superset_app | File "/app/.venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
superset_app | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
superset_app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset_app | File "/app/.venv/lib/python3.11/site-packages/flask_appbuilder/security/decorators.py", line 109, in wraps
superset_app | return f(self, *args, **kwargs)
superset_app | ^^^^^^^^^^^^^^^^^^^^^^^^
superset_app | File "/app/superset/views/base_api.py", line 120, in wraps
superset_app | duration, response = time_function(f, self, *args, **kwargs)
superset_app | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
superset_app | File "/app/superset/utils/core.py", line 1363, in time_function
superset_app | response = func(*args, **kwargs)
superset_app | ^^^^^^^^^^^^^^^^^^^^^
superset_app | File "/app/superset/utils/log.py", line 303, in wrapper
superset_app | value = f(*args, **kwargs)
superset_app | ^^^^^^^^^^^^^^^^^^
superset_app | File "/app/superset/charts/data/api.py", line 239, in data
superset_app | command.validate()
superset_app | File "/app/superset/commands/chart/data/get_data_command.py", line 67, in validate
superset_app | self._query_context.raise_for_access()
superset_app | File "/app/superset/common/query_context.py", line 139, in raise_for_access
superset_app | self._processor.raise_for_access()
superset_app | File "/app/superset/common/query_context_processor.py", line 892, in raise_for_access
superset_app | security_manager.raise_for_access(query_context=self._query_context)
superset_app | File "/app/superset/security/manager.py", line 2350, in raise_for_access
superset_app | raise SupersetSecurityException(
superset_app | superset.exceptions.SupersetSecurityException: This endpoint requires the datasource 20, database or `all_datasource_access` permission
```
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.11
### Node version
16
### Browser
Chrome
### Additional context
- I don't know which node version is used in the docker image.
- I used Brave to test this, but I don't think the browser is relevant here.
I have read through various tickets that seems to also encounter this bug, but no solution describes there solved the issue , and most seems to only be for older version of Superset (and most where riddle with misleading AI slop).
So I decided to open this ticket to show that even with the example data this feature flag doesn't seem to work. Or maybe there are missing steps in the documentation for activating this?
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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.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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "jeremiebedjai (via GitHub)" <gi...@apache.org>.
jeremiebedjai commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2636164008
I ran into the same problem. In my case, the code in the security manager expects a field named `dashboardId`, which was missing in the `formData` object.
Instead, the dashboards field is both included in the schema and actually sent by the frontend, making it more relevant to me. As a result, the check:
```python
and (dashboard_id := form_data.get("dashboardId"))
```
always evaluated to `False`—so the logic for `DASHBOARD_RBAC` never got a chance to run. Patching the code to handle the actual field name (or list of IDs) fixed the issue.
Hope this can help.
--
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
Re: [I] DASHBOARD_RBAC doesn't seems work as intended, even with the example dataset [superset]
Posted by "Mayeu (via GitHub)" <gi...@apache.org>.
Mayeu commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2604147418
Allowing myself to poke direct members of this repository (@villebro, @amitmiran137, @geido), because this bot answer is not useful. I know all those tickets, I have read them, and one of them is just a poor user fighting against that bot.
Please deactivate issue responses from that bot. Auto-labelling is fine, but on most issues I saw here the bot seems to just add noise and confuse users.
--
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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "vhf (via GitHub)" <gi...@apache.org>.
vhf commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2604869883
> From the error it seems the gamma user does not have access to the data source the dashboard is deriving it's data from?
Correct, that's what `DASHBOARD_RBAC` is for, see the documentation: https://superset.apache.org/docs/using-superset/creating-your-first-dashboard/#manage-access-to-dashboards
> * Granting a role access to a dashboard will **bypass dataset level checks**. Having dashboard access implicitly grants read access to all the featured charts in the dashboard, and thereby also all the associated datasets.
--
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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #31938: The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset
URL: https://github.com/apache/superset/issues/31938
--
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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "u35253 (via GitHub)" <gi...@apache.org>.
u35253 commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2635204648
# DASHBOARD_RBAC may not work for datasets included via `dataset()` Jinja template macro
If anyone works on this one, I kindly request please making sure that the case is tested too in which the dataset needed by the dashboard contains a Jinja snippet that includes another dataset as a subquery using the `dataset macro` (e.g., `SELECT * FROM {{ dataset(42) }}`) [0].
- To be clear, this Jinja dataset inclusion is a feature separate from DASHBOARD_RBAC that works fine to nest/generate queries.
- The point of this comment is that it is important to make sure that DASHBOARD_RBAC does let the users access that Jinja-based-nested-subquery dataset as well.
The reason for this comment comment is that, while Jinja nested datasets work, I have recently had to specifically grant dataset access to a Role getting denied dataset that was the nested/Jinja-included dataset used within the dataset of a chart, even though `DASHBOARD_RBAC` was enabled and was anticipated to have allowed access already, according to the docs, since "Granting a role access to a dashboard will bypass dataset level checks."
I'm not 100% sure if it's the same issue bug tracked in this Issue, but it seems like it could be, so I point it out in case there is something there, to be included in testing/bugfixing, please.
Thank you for the great Superset dashboarding software.
[0] https://superset.apache.org/docs/configuration/sql-templating/
--
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
Re: [I] DASHBOARD_RBAC doesn't work as intended, even with the example dataset [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2604121619
<!-- Greeting -->
Hey @Mayeu! 👋
<!-- Answer -->
There are a few similar discussions related to issues with the `DASHBOARD_RBAC` feature in Apache Superset:
1. [Issue with Dashboard Access for Role-Based Permissions (DASHBOARD_RBAC=True)](https://github.com/apache/superset/discussions/30701) - This discussion is unsolved and might provide insights into similar problems <sup>[[1]](https://github.com/apache/superset/discussions/30701)</sup>.
2. [Non-admin user cannot see Edit Dashboard button, even on dashboards they own](https://github.com/apache/superset/discussions/24182) - This is another unsolved discussion that might be related to role-based access issues <sup>[[2]](https://github.com/apache/superset/discussions/24182)</sup>.
3. A closed issue, [RBAC not Working](https://github.com/apache/superset/issues/18634), was resolved by a pull request that fixed the use of normal RBAC when no roles were chosen <sup>[[3]](https://github.com/apache/superset/issues/18634)</sup>.
Regarding your specific issue, the error message indicates that the user lacks the necessary `datasource` or `all_datasource_access` permission. When `DASHBOARD_RBAC` is enabled, users with the Gamma role need explicit `datasource_access` permissions for the datasets associated with the dashboard. You can add this permission by modifying the role's permissions in the security manager <sup>[[4]](https://github.com/apache/superset/blob/master/tests/integration_tests/dashboards/api_tests.py)</sup>.
Additionally, ensure that the `DASHBOARD_RBAC` feature is correctly configured in your `superset_config.py` file, and that the roles are properly assigned to both the user and the dashboard <sup>[[5]](https://github.com/apache/superset/blob/master/docs/docs/configuration/networking-settings.mdx)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/f5c3074a-5b29-48d9-8e3b-326a0b7eed78?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f5c3074a-5b29-48d9-8e3b-326a0b7eed78?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f5c3074a-5b29-48d9-8e3b-326a0b7eed78?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f5c3074a-5b29-48d9-8e3b-326a0b7eed78?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f5c3074a-5b29-48d9-8e3b-326a0b7eed78?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/f5c3074a-5b29-48d9-8e3b-326a0b7eed78?feedback_type=other)</sup>
--
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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "LevisNgigi (via GitHub)" <gi...@apache.org>.
LevisNgigi commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2604842680
From the error it seems the gamma user does not have access to the data source the dashboard is deriving it's data from? Have you give the gamma user permission to access the data source as well? or only assigned the dashboard to the gamma role?
--
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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "mfreyre-smo (via GitHub)" <gi...@apache.org>.
mfreyre-smo commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2641280853
Seems like there was something removed that handled casing differences between the row level security config and the security check on charts in the dashboard. We discovered that if we changed the casing of the table, view, or virtual dataset in the query that the charts were built upon (such that the casing matched the RBAC entry), then it would work.
--
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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2606369529
I always CC @dpgaspar when RBAC bugs come up 🤞
--
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
Re: [I] The DASHBOARD_RBAC feature flag doesn't seem to work as intended, even with the example dataset [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #31938:
URL: https://github.com/apache/superset/issues/31938#issuecomment-2917433781
This has been quiet for a bit now... I think because https://github.com/apache/superset/pull/32646 resolved the issue. I'll go ahead and (perhaps optimisitcally) close this one out, but if it's still a bug that needs resolution, we can open it if you're willing to recap the updated context :)
--
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