Files
authentik/packages/ak-guardian/guardian/exceptions.py
Simonyi Gergő 1b9653901c rbac: clean up roles and permissions (#19588)
* 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>
2026-01-29 19:12:38 +01:00

29 lines
599 B
Python

"""
Exceptions used by ak-guardian. All internal and guardian-specific errors
should extend GuardianError class.
"""
class GuardianError(Exception):
"""Base class for all guardian-specific exceptions."""
pass
class InvalidIdentity(GuardianError):
"""Raised when an object is neither User nor Group nor Role."""
pass
class WrongAppError(GuardianError):
"""Raised when the app name for a permission is incorrect."""
pass
class MixedContentTypeError(GuardianError):
"""Raised when content type for the provided permissions and/or class do not match."""
pass