-
Notifications
You must be signed in to change notification settings - Fork 429
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
feat: Add permission for manage segments overrides #2919
feat: Add permission for manage segments overrides #2919
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2919 +/- ##
==========================================
+ Coverage 95.54% 95.56% +0.01%
==========================================
Files 1012 1013 +1
Lines 29329 29419 +90
==========================================
+ Hits 28023 28114 +91
+ Misses 1306 1305 -1
☔ View full report in Codecov by Sentry. |
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.
I would love to see a couple more tests here - perhaps just some unit test coverage of the permission class, or an API test with a user that has the correct permission.
api/environments/permissions/migrations/0008_add_manage_segment_overrides_permission.py
Show resolved
Hide resolved
…nage_segments_overrides
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.
One minor tweak to a copypasta error. It would also be good to add some typing to the test fixtures 🙏
…nage_segments_overrides
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingChanges
Segment overrides allows release of a specific feature to broader set of users, with this change Flagsmith users are able to have a specialized permission for managing segment overrides as an environment role. See this for more information.
Most of the work in this PR involved trying to understand the surrounding approach and replace permission checks as needed.
I also added
django_extensions
for local development ergonomics as well.How did you test this code?
I relied on the existing tests, following the convention of relying on
admin_master_api_key_client
, but this means that we're not really testing the new permission since it's an admin api key, not a user with the permission.I would like to test this locally with the interface to verify that the permission checks work properly, but I'm opening the PR first to get feedback before setting that all up.I have fully tested this code through a locally running webserver and caught and debugged a few small issues. This PR must wait for merge until the frontend is ready.