-
Notifications
You must be signed in to change notification settings - Fork 16.7k
fix(AllEntities): Display action buttons according to the user permissions #33553
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
fix(AllEntities): Display action buttons according to the user permissions #33553
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
| Category | Issue | Status |
|---|---|---|
| Unmemoized Permission Selector ▹ view | 🧠 Incorrect |
Files scanned
| File Path | Reviewed |
|---|---|
| superset/views/all_entities.py | ✅ |
| superset-frontend/src/features/allEntities/AllEntitiesTable.tsx | ✅ |
| superset-frontend/src/pages/AllEntities/index.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
| const canEditTag = useSelector((state: RootState) => | ||
| findPermission('can_write', 'Tag', state.user?.roles), | ||
| ); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
superset-frontend/src/features/allEntities/AllEntitiesTable.tsx
Outdated
Show resolved
Hide resolved
kgabryje
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
this looks great, thanks @Vitor-Avila! 🙏 |
…sions (apache#33553) (cherry picked from commit 546945e)
SUMMARY
The All Entities view (
/superset/all_entities/?id=${TAG_ID}) was always displaying action buttons (Edit tag and Add tag to entities), regardless if the user had permission to perform these actions or not. This PR makes the visibility of these buttons dynamic.It also updates the list to only display the Dashboards / Charts / Queries list in case they have any item.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before, the list would include all asset types, even if there are no elements:
Now, the list only includes the asset type that has items:

Also changed the button casing from Edit Tag to Edit tag.
Video demonstrating the other buttons:
Tags.video.mov
TESTING INSTRUCTIONS
Added frontend tests. For manual testing:
can_writeperm onTag.ADDITIONAL INFORMATION