From 0ca86869d8acaa8a820df45fc1debfbe1b7936df Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 25 Jun 2024 13:19:26 -0500 Subject: Remove flawed "group role" idea: use just "role". --- gn2/wqflask/oauth2/resources.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gn2/wqflask/oauth2') diff --git a/gn2/wqflask/oauth2/resources.py b/gn2/wqflask/oauth2/resources.py index 7ebb82ad..66545802 100644 --- a/gn2/wqflask/oauth2/resources.py +++ b/gn2/wqflask/oauth2/resources.py @@ -213,10 +213,10 @@ def unlink_data_from_resource(): @require_oauth2 def assign_role(resource_id: UUID) -> Response: form = request.form - group_role_id = form.get("group_role_id", "") + role_id = form.get("role_id", "") user_email = form.get("user_email", "") try: - assert bool(group_role_id), "The role must be provided." + assert bool(role_id), "The role must be provided." assert bool(user_email), "The user email must be provided." def __assign_error__(error): @@ -233,7 +233,7 @@ def assign_role(resource_id: UUID) -> Response: return oauth2_post( f"auth/resource/{resource_id}/user/assign", json={ - "group_role_id": group_role_id, + "role_id": role_id, "user_email": user_email }).either(__assign_error__, __assign_success__) except AssertionError as aserr: @@ -244,10 +244,10 @@ def assign_role(resource_id: UUID) -> Response: @require_oauth2 def unassign_role(resource_id: UUID) -> Response: form = request.form - group_role_id = form.get("group_role_id", "") + role_id = form.get("role_id", "") user_id = form.get("user_id", "") try: - assert bool(group_role_id), "The role must be provided." + assert bool(role_id), "The role must be provided." assert bool(user_id), "The user id must be provided." def __unassign_error__(error): @@ -264,7 +264,7 @@ def unassign_role(resource_id: UUID) -> Response: return oauth2_post( f"auth/resource/{resource_id}/user/unassign", json={ - "group_role_id": group_role_id, + "role_id": role_id, "user_id": user_id }).either(__unassign_error__, __unassign_success__) except AssertionError as aserr: -- cgit v1.2.3