From 766ceda57a6dfa6d12232aec5e64cb4df2a66088 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 1 Jul 2022 17:03:39 +0200 Subject: [PATCH] core: re-create anonymous user when repairing permissions Signed-off-by: Jens Langhammer --- .../management/commands/repair_permissions.py | 2 ++ authentik/outposts/management/__init__.py | 0 authentik/outposts/management/commands/__init__.py | 0 3 files changed, 2 insertions(+) rename authentik/{outposts => core}/management/commands/repair_permissions.py (83%) delete mode 100644 authentik/outposts/management/__init__.py delete mode 100644 authentik/outposts/management/commands/__init__.py diff --git a/authentik/outposts/management/commands/repair_permissions.py b/authentik/core/management/commands/repair_permissions.py similarity index 83% rename from authentik/outposts/management/commands/repair_permissions.py rename to authentik/core/management/commands/repair_permissions.py index cae7976ea..10dc9423a 100644 --- a/authentik/outposts/management/commands/repair_permissions.py +++ b/authentik/core/management/commands/repair_permissions.py @@ -2,6 +2,7 @@ from django.apps import apps from django.contrib.auth.management import create_permissions from django.core.management.base import BaseCommand, no_translations +from guardian.management import create_anonymous_user class Command(BaseCommand): # pragma: no cover @@ -13,3 +14,4 @@ class Command(BaseCommand): # pragma: no cover for app in apps.get_app_configs(): self.stdout.write(f"Checking app {app.name} ({app.label})\n") create_permissions(app, verbosity=0) + create_anonymous_user(None, using="default") diff --git a/authentik/outposts/management/__init__.py b/authentik/outposts/management/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/authentik/outposts/management/commands/__init__.py b/authentik/outposts/management/commands/__init__.py deleted file mode 100644 index e69de29bb..000000000