aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask
diff options
context:
space:
mode:
Diffstat (limited to 'gn2/wqflask')
-rw-r--r--gn2/wqflask/oauth2/resources.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/gn2/wqflask/oauth2/resources.py b/gn2/wqflask/oauth2/resources.py
index cf600b51..0befac85 100644
--- a/gn2/wqflask/oauth2/resources.py
+++ b/gn2/wqflask/oauth2/resources.py
@@ -4,6 +4,7 @@ from flask import (
flash, request, url_for, redirect, Response, Blueprint)
from . import client
+from . import session
from .ui import render_ui as _render_ui
from .checks import require_oauth2
from .client import oauth2_get, oauth2_post
@@ -408,9 +409,12 @@ def create_resource_role(resource_id: UUID):
return render_ui("oauth2/create-role.html", **kwargs)
def __fetch_resource_roles__(resource):
- return oauth2_get(f"auth/resource/{resource_id}/roles").either(
lambda error: __render__(resource_role_error=error),
- lambda roles: {"resource": resource, "roles": roles})
+ user = session.session_info()["user"]
+ return oauth2_get(
+ f"auth/resource/{resource_id}/users/{user['user_id']}"
+ "/roles").either(
+ lambda roles: {"resource": resource, "roles": roles})
if request.method == "GET":
return oauth2_get(f"auth/resource/view/{resource_id}").map(