Files
authentik/packages/ak-guardian/guardian/__init__.py
Simonyi Gergő f7e23295ed core: add digraph group hierarchy (#17050)
* 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>
2025-12-08 12:04:04 +01:00

26 lines
1007 B
Python

"""
Implementation of per object permissions for Django.
"""
def get_version():
"""Return the version string (see pyproject.toml) of the package.
The value will comply with the [python version specifier format dicted by
PEP440](https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers)
Standards for packaging metadata — including version — are defined by PEP 621,
which specifies how to declare version in pyproject.toml.
The earlier PEP 396 suggests (but does not mandate) having a __version__
attribute in __init__.py for the purposes of runtime introspection, but
it leads to confusion in our development process to define it multiple places.
PEP 396 has now been revoked, but it is still useful to be able to inspect
the package version at runtime. This function retains that ability using the
recommended importlib approach.
"""
from importlib.metadata import version
return version("ak-guardian")