Skip to content

Commit

Permalink
Fix permission issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshhari committed Jan 5, 2025
1 parent e78db7c commit f7c5bf7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion care/security/authorization/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ def can_create_user(self, user):
"""
if user.is_superuser:
return True
roles = self.get_role_from_permissions([UserPermissions.can_create_user.value])
roles = AuthorizationHandler().get_role_from_permissions(
[UserPermissions.can_create_user.name]
)
return (
OrganizationUser.objects.filter(user=user, role_id__in=roles).exists()
or FacilityOrganizationUser.objects.filter(
Expand Down

0 comments on commit f7c5bf7

Please sign in to comment.