Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"View in SQL Lab" button in charts displayed on the basis of role instead of permission #24902

Closed
3 tasks done
giftig opened this issue Aug 7, 2023 · 1 comment
Closed
3 tasks done

Comments

@giftig
Copy link
Contributor

giftig commented Aug 7, 2023

In the chart wizard, the "view in SQL Lab" button only appears in the context menu for the dataset if the user specifically has the sql_lab role, rather than depending on the relevant permission associated with this action: [SQL Lab].[menu_access]. Update this check to look for the permission instead of the role. Since the sql_lab role has that permission, it will continue to work as normal, but with a more appropriate check.

This fixes for the case where this permission has been assigned to a different role.

How to reproduce the bug

  1. Add the [SQL Lab].[menu_access] role to the Gamma role, or some other role associated with a user
  2. As a Gamma user, view a dataset in the chart explorer
  3. Click on the three dots next to the dataset name in the top left
  4. See that View in SQL Lab button is missing

Expected results

User should see the option to go to SQL Lab as they have SQL Lab access.

Actual results

Button is missing on the frontend.

Environment

(please complete the following information):

  • browser type and version: N/A
  • superset version: 2.1.0
  • python version: N/A
  • node.js version: N/A
  • any feature flags active:

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

I discussed this with @villebro who made the original change to check the role and agreed on the solution being to check the permission I named here instead; I'll raise a PR for this issue now as I already have this fixed and tested in our fork.

@giftig
Copy link
Contributor Author

giftig commented Aug 7, 2023

PR: #24903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants