aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/oauth2/routes.py
diff options
context:
space:
mode:
Diffstat (limited to 'wqflask/wqflask/oauth2/routes.py')
-rw-r--r--wqflask/wqflask/oauth2/routes.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/wqflask/wqflask/oauth2/routes.py b/wqflask/wqflask/oauth2/routes.py
index ad0c080e..6fed4064 100644
--- a/wqflask/wqflask/oauth2/routes.py
+++ b/wqflask/wqflask/oauth2/routes.py
@@ -1,4 +1,5 @@
"""Routes for the OAuth2 auth system in GN3"""
+import uuid
import requests
from typing import Optional
from urllib.parse import urljoin
@@ -239,7 +240,7 @@ def user_resources():
@oauth2.route("/user-roles", methods=["GET"])
def user_roles():
def __success__(roles):
- return render_template("oauth2/roles.html", roles=roles)
+ return render_template("oauth2/list_roles.html", roles=roles)
return oauth2_get("oauth2/user-roles").either(
__request_error__, __success__)
@@ -251,3 +252,11 @@ def user_group():
return oauth2_get("oauth2/user-group").either(
__request_error__, __success__)
+
+@oauth2.route("/role/<uuid:role_id>", methods=["GET"])
+def role(role_id: uuid.UUID):
+ def __success__(the_role):
+ return render_template("oauth2/role.html", role=the_role)
+
+ return oauth2_get(f"oauth2/role/{role_id}").either(
+ __request_error__, __success__)