-
Notifications
You must be signed in to change notification settings - Fork 324
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
[BUG] fix Location/ Bed Management issue ( District Lab Admin Account) #1959
[BUG] fix Location/ Bed Management issue ( District Lab Admin Account) #1959
Conversation
@rithviknishad @sainak pls take a look works fine for me |
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.
A state lab admin and greater user would have access to facilities belonging to the user's state and not user's district
Also, need tests |
@rithviknishad i did not understand this comment what change is needed we dont allow object read for district lab admin ? i added it to district lab admin as in FacilityQSPermissions we allow DistrictLabAdmin to view it |
okay is this what ur saying
also same changes for statelabadmin as well |
hey i just noticed that for model AssetLocation we dont have a field named state thats why its failing for assetlocation where as for facility we have state so this fixed the facility permission issue part but shows the error while managing beds |
We don't need to add a state field as it'd no longer be having a single source of truth. A facility belongs to a state and Asset Location belongs to a facility. Bed belongs to an Asset Location. |
@rithviknishad i have added tests and also did the same for state lab admin looks good to me let me know if any changes are required |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1959 +/- ##
===========================================
+ Coverage 62.19% 62.35% +0.15%
===========================================
Files 221 221
Lines 12203 12219 +16
Branches 1742 1744 +2
===========================================
+ Hits 7590 7619 +29
+ Misses 4305 4289 -16
- Partials 308 311 +3 ☔ View full report in Codecov by Sentry. |
@khavinshankar pls take a look |
Proposed Changes
the issue here was mainly permission related
District Lab Admin had read access for facility but not object read access (refer FacilityPermissionMixin)
same for asset_location while actually managing beds it uses (refer FacilityRelatedPermissionMixin)
Associated Issue
Merge Checklist
/docs
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@coronasafe/care-backend-maintainers @coronasafe/care-backend-admins