Skip to content

Commit

Permalink
Update permissions.py to original
Browse files Browse the repository at this point in the history
  • Loading branch information
Vignesh16879 authored Nov 11, 2024
1 parent 4f91723 commit 5975ac8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cvat/apps/iam/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,17 @@ def get_resource(self):
def check_access(self) -> PermissionResult:
with make_requests_session() as session:
response = session.post(self.url, json=self.payload)
# output = response.json()['result']
output = response.json()['result']

allow = True
reasons = []
# if isinstance(output, dict):
# allow = output['allow']
# reasons = output.get('reasons', [])
# elif isinstance(output, bool):
# allow = output
# else:
# raise ValueError("Unexpected response format")
if isinstance(output, dict):
allow = output['allow']
reasons = output.get('reasons', [])
elif isinstance(output, bool):
allow = output
else:
raise ValueError("Unexpected response format")

return PermissionResult(allow=allow, reasons=reasons)

Expand Down

0 comments on commit 5975ac8

Please sign in to comment.