fix(report): Fix permission check for set up email report on charts/dashboards. Fixes #21559 #21561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
set up email report button should be enabled for users who have "menu_access on Manage" permission. However, the previous implementation only checks if the first role associated with the user has the required permission, not the others. For those who were granted with the permission through other roles, they won't be able to see the button.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
After
TESTING INSTRUCTIONS
I have tested with our own superset stack. With the same set of permissions, before the change, the user couldn't see the button. But after the change, the button shows up.
ADDITIONAL INFORMATION