feat(rbac): add customizable related filters #22526
Merged
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
This is a continuation of #21515, which made it possible to exclude specific users from dropdown lists, to make it possible to add arbitrary filter conditions to both the user and role dropdowns. The primary reason for this is to be able to restrict the available roles in the Dashboard role dropdown when using
DASHBOARD_RBAC
, as users may unintentionally give too wide access to dashboards by sharing with a too generic role. Similarly, there may be a need to restrict to whom a user should be able to give ownership of an object.To demonstrate, by adding the following to
superset_config.py
, the owners dropdown now only contains the entryadmin
, and the roles dropdown only contains entries starting with the letter "A":Now users only displays "Admin":
Similarly roles only contains "Admin" and "Alpha":
TESTING INSTRUCTIONS
superset_config.py
ADDITIONAL INFORMATION