From 61f404640c17d8a9a330e57ecdecac11b387dd57 Mon Sep 17 00:00:00 2001 From: Vignesh16879 Date: Wed, 11 Sep 2024 15:48:36 +0530 Subject: [PATCH] notifications --- cvat/apps/iam/permissions.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cvat/apps/iam/permissions.py b/cvat/apps/iam/permissions.py index 5ed0c706f924..d8b0a434b4f9 100644 --- a/cvat/apps/iam/permissions.py +++ b/cvat/apps/iam/permissions.py @@ -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)