Skip to content

Commit

Permalink
fix permission
Browse files Browse the repository at this point in the history
  • Loading branch information
marceloarocha committed Jan 4, 2024
1 parent 3ab63db commit 6100cf8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions routes/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ def setPatientData(admissionNumber):

updateWeight = False

if RoleEnum.READONLY.value in roles:
if RoleEnum.READONLY.value in roles and not (
RoleEnum.ADMIN.value in roles or RoleEnum.TRAINING.value in roles
):
return {
"status": "error",
"message": "Permissão inválida",
}, status.HTTP_401_UNAUTHORIZED

if RoleEnum.SUPPORT.value not in roles:
if RoleEnum.SUPPORT.value not in roles and RoleEnum.READONLY.value not in roles:
if "weight" in data.keys():
weight = data.get("weight", None)

Expand Down

0 comments on commit 6100cf8

Please sign in to comment.