Skip to content

Commit

Permalink
revert patient permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Aug 1, 2022
1 parent c2cdced commit 74e303c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions care/facility/models/mixins/permissions/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ def has_write_permission(request):
return False
return (
request.user.is_superuser
or request.user.user_type >= User.TYPE_VALUE_MAP["DistrictAdmin"]
or request.user.user_type == User.TYPE_VALUE_MAP["Doctor"]
and request.user.user_type >= User.TYPE_VALUE_MAP["Staff"]
)

def has_object_read_permission(self, request):
Expand All @@ -148,12 +147,7 @@ def has_object_update_permission(self, request):
if (
request.user.user_type == User.TYPE_VALUE_MAP["DistrictReadOnlyAdmin"]
or request.user.user_type == User.TYPE_VALUE_MAP["StateReadOnlyAdmin"]
or request.user.user_type == User.TYPE_VALUE_MAP["StaffReadOnly"]
):
return False
return (
self.has_object_read_permission(request)
and (
request.user.user_type == User.TYPE_VALUE_MAP["Doctor"]
or request.user.user_type >= User.TYPE_VALUE_MAP["DistrictAdmin"]
)
)
return self.has_object_read_permission(request)

0 comments on commit 74e303c

Please sign in to comment.