core: fallback to empty user object for PropertyMappingEvaluator

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-10-18 21:41:00 +02:00
parent 0efee2a660
commit 6bff6a2a1a
1 changed files with 1 additions and 2 deletions

View File

@ -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