From 3094afcbf3cc39e19498d8207401db6dafc2ecbd Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 12 Oct 2023 02:20:33 +0300 Subject: CaseAttribute: Bug: enumerate the privileges correctly. --- gn3/case_attributes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gn3/case_attributes.py b/gn3/case_attributes.py index 19d6c54..9182237 100644 --- a/gn3/case_attributes.py +++ b/gn3/case_attributes.py @@ -69,8 +69,8 @@ def required_access(inbredset_id: int, access_levels: tuple[str, ...]) -> bool: json={"resource-ids": [resource_id]}, headers={"Authorization": f"Bearer {the_token.access_token}"}) if auth.status_code == 200: - privs = (priv.privilege_id for role in auth.json()[resource_id]["roles"] - for priv in role) + privs = (priv["privilege_id"] for role in auth.json()[resource_id]["roles"] + for priv in role["privileges"]) authorisedp = all(lvl in privs for lvl in access_levels) if authorisedp: return authorisedp -- cgit 1.4.1