Skip to content

Commit

Permalink
notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Vignesh16879 committed Sep 11, 2024
1 parent e3bf29f commit 61f4046
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cvat/apps/iam/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,17 @@ def check_access(self) -> PermissionResult:
with make_requests_session() as session:
response = session.post(self.url, json=self.payload)
output = response.json()
# output = output['result']
output = output['result']

allow = True
allow = False
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 61f4046

Please sign in to comment.