diff --git a/auth-api/src/auth_api/resources/v1/user.py b/auth-api/src/auth_api/resources/v1/user.py index 5b58e5f8c..372f77b00 100644 --- a/auth-api/src/auth_api/resources/v1/user.py +++ b/auth-api/src/auth_api/resources/v1/user.py @@ -111,7 +111,7 @@ def post_user(): # Ensure STAFF doesn't have GOV_ACCOUNT_USER, otherwise they get extra permissions they shouldn't have. roles = token.get("realm_access", {}).get("roles", []) - if Role.STAFF.name in roles and Role.GOV_ACCOUNT_USER.value in roles: + if Role.STAFF.value in roles and Role.GOV_ACCOUNT_USER.value in roles: current_app.logger.info("Removing GOV_ACCOUNT_USER group from STAFF user") KeycloakService.remove_user_from_group(token.get("sub"), GROUP_GOV_ACCOUNT_USERS)