From f4581de84aba69f7e459f30f43ea38563a644b02 Mon Sep 17 00:00:00 2001 From: Jeremy Gibson Date: Tue, 16 Jul 2024 11:42:18 -0400 Subject: [PATCH] LIBS-27 load policies --- auth_checker/authz/routes.py | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/auth_checker/authz/routes.py b/auth_checker/authz/routes.py index 0a619e8..1a5ca8e 100644 --- a/auth_checker/authz/routes.py +++ b/auth_checker/authz/routes.py @@ -18,6 +18,7 @@ def authorize( :param valid: The token validator dependency. Contains the user's account information. :returns: A boolean indicating whether the user is authorized to perform the action. """ + authz.enforcer.load_policy() try: if not authz.authorize(valid.account.email, resource, action): raise HTTPException( @@ -38,6 +39,7 @@ def get_roles(valid: Annotated[TokenValidator, Depends(TokenValidator)]): :param valid: The token validator dependency. Contains the user's account information. :returns: A list of roles assigned to the user. """ + authz.enforcer.load_policy() try: return {"roles": authz.roles_for_user(valid.account.email)} except AttributeError as ae: diff --git a/pyproject.toml b/pyproject.toml index 6b32655..1fdbc35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ build-backend = "flit_core.buildapi" [project] name = "auth-checker" -version = "2.0.5" +version = "2.0.6" authors = [ { name="Ryan Semmler", email="rsemmle@ncsu.edu" }, { name="Luc Sanchez", email="lgsanche@ncsu.edu" },