diff options
Diffstat (limited to 'gn3/auth/authorisation/checks.py')
-rw-r--r-- | gn3/auth/authorisation/checks.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gn3/auth/authorisation/checks.py b/gn3/auth/authorisation/checks.py index 3181655..dd041fe 100644 --- a/gn3/auth/authorisation/checks.py +++ b/gn3/auth/authorisation/checks.py @@ -16,11 +16,11 @@ def authorised_p( def __build_authoriser__(func: Callable): @wraps(func) def __authoriser__(*args, **kwargs): - if hasattr(g, "user_id") and g.user_id: + if hasattr(g, "user") and g.user: with db.connection(app.config["AUTH_DB"]) as conn: user_privileges = tuple( priv.privilege_name for priv in - auth_privs.user_privileges(conn, g.user_id)) + auth_privs.user_privileges(conn, g.user)) not_assigned = [ priv for priv in privileges if priv not in user_privileges] |