-
Notifications
You must be signed in to change notification settings - Fork 435
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
Refactor user delete permissions to allow StateAdmin and DistrictAdmin #6781
Conversation
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Passing run #1662 ↗︎
Details:
Review all test suite changes for PR #6781 ↗︎ |
👋 Hi, @Ashesh3, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
LGTM |
@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌. |
Backend PR: ohcnetwork/care#1738
WHAT
🤖[deprecated] Generated by Copilot at 6ab927b
This pull request proposes changes to the way user deletion privileges are granted. Previously, it was based on the code which is directly visible in the user module file, but now it has been moved to a utility function.
In the
FacilityUsers.tsx
andManageUsers.tsx
files, the validation for user deletion access was directly placed within the component. However, to ensure cleaner code and avoid duplication, the logic has been moved to theutils.ts
file, inside a new function calledshowUserDelete
. As per the function logic, only users who areStateAdmins
from the same state as the target user orDistrictAdmins
from the same district can delete users.This pull request hence not only enhances the readability and maintainability of our code but also successfully implements the needed feature of granting user deletion privileges to district admin and above.
Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
HOW
🤖[deprecated] Generated by Copilot at 6ab927b
No walkthrough available (Limit exceeded: required to process 57580 tokens, but only 50000 are allowed per call)