THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class AuthorizationSnapshot(IAuthorizationSnapshot): (source)
Constructor: AuthorizationSnapshot(permissions, roles, abilities)
Hold the immutable authorization picture of a single request.
Effective authorization is the intersection of what the identity owns and what the presented credential is allowed to use:
effective = identity permissions ∩ credential abilities
A credential without abilities (None) never narrows the identity, and abilities alone can never grant a permission the identity lacks.
Concurrency
Instances are fully immutable once built, so they can be shared by every coroutine handling the same request without synchronisation.
| Method | __init__ |
Build a snapshot from the resolved authorization sources. |
| Method | __repr__ |
Return a debugging representation of the snapshot. |
| Method | can |
Report whether the effective authorization grants a permission. |
| Method | has |
Report whether the identity owns a role. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | __abilities |
Undocumented |
| Instance Variable | __permissions |
Undocumented |
| Instance Variable | __roles |
Undocumented |
| Property | abilities |
Return the abilities restricting the presented credential. |
| Property | permissions |
Return the permissions owned by the identity. |
| Property | roles |
Return the roles assigned to the identity. |
Iterable[ str], roles: Iterable[ str], abilities: Iterable[ str] | None = None):
(source)
¶
Build a snapshot from the resolved authorization sources.
| Parameters | |
permissions:Iterable[str] | Permission names owned by the identity, direct ones and the ones inherited from its roles. |
roles:Iterable[str] | Role names assigned to the identity. |
abilities:Iterable[str] | None, optional | Abilities restricting the presented credential. |
| Returns | |
None | The snapshot is initialised with immutable collections. |
Return a debugging representation of the snapshot.
| Returns | |
str | Compact description with the collection sizes only. |