mirror of
https://github.com/goauthentik/authentik
synced 2026-05-01 11:57:09 +02:00
* clean up roles and permissions This was purposefully not included in `2025.12` to split the changes up. The main content of this patch is in the migrations. Everything else follows more or less automatically. * add breaking change warning to release notes * add `ak_groups` --> `groups` deprecated proxy * fixup! add `ak_groups` --> `groups` deprecated proxy * fixup! add `ak_groups` --> `groups` deprecated proxy * fixup! add `ak_groups` --> `groups` deprecated proxy * add configuration warning to default notifications blueprint * add rudimentary tests for User.ak_groups * remove no longer used permissions * clarify deprecation Co-authored-by: Jens L. <jens@goauthentik.io> Signed-off-by: Simonyi Gergő <28359278+gergosimonyi@users.noreply.github.com> * remove integration changes These will be included in a separate PR once this is released. --------- Signed-off-by: Simonyi Gergő <28359278+gergosimonyi@users.noreply.github.com> Co-authored-by: Jens L. <jens@goauthentik.io>
18 lines
891 B
Python
18 lines
891 B
Python
from django.conf import settings
|
|
from django.core.exceptions import ImproperlyConfigured
|
|
|
|
ANONYMOUS_USER_NAME = getattr(settings, "GUARDIAN_ANONYMOUS_USER_NAME", "AnonymousUser")
|
|
GET_INIT_ANONYMOUS_USER = getattr(
|
|
settings, "GUARDIAN_GET_INIT_ANONYMOUS_USER", "guardian.management.get_init_anonymous_user"
|
|
)
|
|
# Anonymous user cache TTL configuration
|
|
# 0 = no cache (default), positive number = cache TTL in seconds, -1 = cache indefinitely
|
|
ANONYMOUS_USER_CACHE_TTL = getattr(settings, "GUARDIAN_ANONYMOUS_USER_CACHE_TTL", 0)
|
|
|
|
group_model_label = getattr(settings, "GUARDIAN_GROUP_MODEL", None)
|
|
role_model_label = getattr(settings, "GUARDIAN_ROLE_MODEL", None)
|
|
if group_model_label is None:
|
|
raise ImproperlyConfigured("ak-guardian requires settings.GUARDIAN_GROUP_MODEL")
|
|
if role_model_label is None:
|
|
raise ImproperlyConfigured("ak-guardian requires settings.GUARDIAN_ROLE_MODEL")
|