diff options
author | Frederick Muriuki Muriithi | 2023-01-04 06:34:30 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-01-04 06:34:30 +0300 |
commit | dcd09e820ff142a8ca932363a0b67b72182d355c (patch) | |
tree | f9b42e1630af81e41ebbc914f6c98edf36a4f225 /gn3/auth/authorisation/views.py | |
parent | 0a31f61ee9db84eb35087073ef6b58f352252aae (diff) | |
download | genenetwork3-dcd09e820ff142a8ca932363a0b67b72182d355c.tar.gz |
auth: Return only non-resource roles on `/user-roles` endpoint
Resource roles will be returned as part of the resources request.
* gn3/auth/authorisation/roles.py: Simplify query - only get non-resource
roles
* gn3/auth/authorisation/views.py: update docstring
Diffstat (limited to 'gn3/auth/authorisation/views.py')
-rw-r--r-- | gn3/auth/authorisation/views.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/auth/authorisation/views.py b/gn3/auth/authorisation/views.py index 2481633..2a419af 100644 --- a/gn3/auth/authorisation/views.py +++ b/gn3/auth/authorisation/views.py @@ -9,7 +9,7 @@ from ..authentication.oauth2.resource_server import require_oauth @oauth2.route("/user-roles") @require_oauth def user_roles(): - """Return the roles assigned to the user.""" + """Return the non-resource roles assigned to the user.""" with require_oauth.acquire("role") as token: with db.connection(current_app.config["AUTH_DB"]) as conn: return jsonify(_user_roles(conn, token.user)) |