-
Notifications
You must be signed in to change notification settings - Fork 435
fix: permissions not revoked after view project disabled #5438
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
base: main
Are you sure you want to change the base?
fix: permissions not revoked after view project disabled #5438
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Docker builds report
|
Uffizzi Ephemeral Environment Deploying☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5438 ⚙️ Updating now by workflow run 14928873199. What is Uffizzi? Learn more! |
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.
Pull Request Overview
This PR addresses the issue where permissions are not being revoked after a view project is disabled by refactoring the permission lookup and toggle logic, and by improving user feedback during permission changes.
- Refactored the processResults logic by extracting separate functions for finding permissions by group, role, or user.
- Introduced a new RemoveViewPermissionModal component to confirm removal of view permissions and replaced direct tag query usage.
- Added a new utility function (capitalize) to standardize string capitalization and updated toast messages accordingly.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
frontend/web/components/EditPermissions.tsx | Refactored permission processing logic, updated permission toggle behavior to use a confirmation modal, and improved button state handling. |
frontend/common/utils/utils.tsx | Added a new capitalize utility function to improve the consistency of string casing. |
Comments suppressed due to low confidence (1)
frontend/web/components/EditPermissions.tsx:985
- [nitpick] The onChange handler contains nested conditions for handling view permission toggling. Consider extracting this logic into a helper function to improve readability and maintainability.
if (level !== 'organisation' && p.key === viewPermission && hasPermission(viewPermission) && entityPermissions.permissions.length > 1) {
Co-authored-by: Copilot <[email protected]>
Ref: #5432
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Ref: #5432
https://www.loom.com/share/a321aefb3f8d4298a181876f6b67baab?sid=f652b515-569d-4aee-a957-a93ebcd93466
Please describe.
How did you test this code?
Please describe.