mirror of
https://github.com/goauthentik/authentik.git
synced 2026-08-30 18:51:39 -07:00
* move imports * core: add digraph group hierarchy * move to permissions from Group or User to Role * set group parents on frontend * do not serialize `GroupParentageNode` directly * core: enforce unique group name on database level Signed-off-by: Jens Langhammer <jens@goauthentik.io> * use group parents in LDAP provider * add user-role relationship control to frontend * move materialized view to be more discoverable * add guardian to mypy exceptions * make `Role` a `ManagedModel` * fixup! make `Role` a `ManagedModel` * simplify `get_objects_for_user` * fix flaky unit test * rename `django-guardian` fork to `ak-guardian` * add tests around users/groups/roles * remove unused guardian config variable * simplify guardian file structure * clean up frontend * initial docs * remove `mode` from `InitialPermissions` This is no longer needed, since users no longer directly have permissions. * fixup! Merge branch 'main' into core/add-digraph-group-hierarchy * clean up docs for managing permissions * addendums from docs review * fixup! Merge branch 'main' into core/add-digraph-group-hierarchy * tweaks * dewi and tana edits to docs * tweak * truly final tweaks, for now * relabel Role Permissions table * clarify button label * fixup! Merge branch 'main' into core/add-digraph-group-hierarchy * fixup! Merge branch 'main' into core/add-digraph-group-hierarchy * merge migrations * fixup! Merge branch 'main' into core/add-digraph-group-hierarchy --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Tana M Berry <tana@goauthentik.io>
41 lines
865 B
Python
41 lines
865 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 ObjectNotPersisted(GuardianError):
|
|
"""Raised when the object has not been saved to the database."""
|
|
|
|
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
|
|
|
|
|
|
class MultipleIdentityAndObjectError(GuardianError):
|
|
"""Raised when an operation is attempted on both user/group and object."""
|
|
|
|
pass
|