ORIONIS API REFERENCE

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 documentation

class IPolicy(ABC): (source)

Known subclasses: orionis.auth.authorization.Policy

View In Hierarchy

Define the contract shared by every resource policy.

A permission answers "may this identity perform this capability?". A policy answers "may this identity perform this operation on this resource?", so it receives the resource together with the identity.

Async Method before Short circuit the policy before the ability method runs.
Class Variable __slots__ Undocumented
@abstractmethod
async def before(self, identity: object, ability: str) -> bool | None: (source)

Short circuit the policy before the ability method runs.

Parameters
identity:objectAuthenticated identity being evaluated.
ability:strName of the ability requested on the resource.
Returns
bool | NoneTrue to allow and False to deny without calling the ability method, or None to continue the normal evaluation.
__slots__: tuple = (source)

Undocumented