From 6bff6a2a1a2d7e2575675a2e226517922b8fee7b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Tue, 18 Oct 2022 21:41:00 +0200 Subject: [PATCH] core: fallback to empty user object for PropertyMappingEvaluator Signed-off-by: Jens Langhammer --- authentik/core/expression/evaluator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/authentik/core/expression/evaluator.py b/authentik/core/expression/evaluator.py index 3d1ad6b01..71557144a 100644 --- a/authentik/core/expression/evaluator.py +++ b/authentik/core/expression/evaluator.py @@ -4,7 +4,6 @@ from typing import Optional from django.db.models import Model from django.http import HttpRequest -from guardian.utils import get_anonymous_user from authentik.core.models import User from authentik.events.models import Event, EventAction @@ -27,7 +26,7 @@ class PropertyMappingEvaluator(BaseEvaluator): else: _filename = str(model) super().__init__(filename=_filename) - req = PolicyRequest(user=get_anonymous_user()) + req = PolicyRequest(user=User()) req.obj = model if user: req.user = user