From e7c136949d3daf5310b33423f27918aaa9e92c65 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 3 Mar 2023 14:02:10 +0300 Subject: oauth2: group role: View group role details. --- wqflask/wqflask/oauth2/groups.py | 17 +++++++++++++++++ wqflask/wqflask/templates/oauth2/list_roles.html | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/oauth2/groups.py b/wqflask/wqflask/oauth2/groups.py index f9e9bffe..2effaae8 100644 --- a/wqflask/wqflask/oauth2/groups.py +++ b/wqflask/wqflask/oauth2/groups.py @@ -1,3 +1,4 @@ +import uuid import datetime from functools import partial @@ -131,3 +132,19 @@ def reject_join_request(): data=request.form).either( handle_error("oauth2.group.list_join_requests"), __success__) + +@groups.route("/role/", methods=["GET"]) +@require_oauth2 +def group_role(group_role_id: uuid.UUID): + """View the details of a particular role.""" + def __role_error__(error): + return render_template( + "oauth2/view-group-role.html", + group_role_error=process_error(error)) + + def __role_success__(role): + return render_template( + "oauth2/view-group-role.html", group_role=role) + + return oauth2_get(f"oauth2/group/role/{group_role_id}").either( + __role_error__, __role_success__) diff --git a/wqflask/wqflask/templates/oauth2/list_roles.html b/wqflask/wqflask/templates/oauth2/list_roles.html index 7d9c4ac2..6feccb6f 100644 --- a/wqflask/wqflask/templates/oauth2/list_roles.html +++ b/wqflask/wqflask/templates/oauth2/list_roles.html @@ -52,7 +52,7 @@ {{grole.role.role_name}} - View -- cgit v1.2.3