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 DatabasePermissionRepository(IPermissionRepository): (source)

Constructor: DatabasePermissionRepository(db)

View In Hierarchy

Load permissions and roles from the framework authorization tables.

Roles, direct permissions and role permissions are resolved in one UNION statement, once per request. No intermediate role-ID list can become stale between separate reads. Later checks use the snapshot.

Concurrency

The repository is stateless and safe to register as a singleton. It only issues read queries, so concurrent calls never interfere.

Method __directPermissionsOf Build the direct-permission arm of the authorization statement.
Method __init__ Initialise the repository with the model-less query gateway.
Method __rolePermissionsOf Build inherited permissions constrained to the current owner's roles.
Method __rolesOf Build the role arm of the authorization statement.
Async Method loadFor Load the permissions and roles owned by an identity.
Class Variable __slots__ Undocumented
Instance Variable __db Undocumented
def __directPermissionsOf(self, model_type: str, model_id: object) -> IRawQueryBuilder: (source)

Build the direct-permission arm of the authorization statement.

Parameters
model_type:strPolymorphic type stored in the pivot table.
model_id:objectIdentifier stored in the pivot table.
Returns
IRawQueryBuilderQuery exposing direct permission names and their kind.
def __init__(self, db: IQueryBuilder): (source)

Initialise the repository with the model-less query gateway.

Parameters
db:IQueryBuilderGateway used to build queries over the authorization tables.
Returns
NoneThe repository keeps only the injected gateway.
def __rolePermissionsOf(self, model_type: str, model_id: object) -> IRawQueryBuilder: (source)

Build inherited permissions constrained to the current owner's roles.

Parameters
model_type:strStable polymorphic owner type.
model_id:objectCanonical identifier of the owner.
Returns
IRawQueryBuilderQuery exposing permissions from roles attached in this statement.
def __rolesOf(self, model_type: str, model_id: object) -> IRawQueryBuilder: (source)

Build the role arm of the authorization statement.

Parameters
model_type:strPolymorphic type stored in the pivot table.
model_id:objectIdentifier stored in the pivot table.
Returns
IRawQueryBuilderQuery exposing role names tagged with their authorization kind.
async def loadFor(self, authorizable: IAuthorizable) -> tuple[frozenset[str], frozenset[str]]: (source)

Load the permissions and roles owned by an identity.

Parameters
authorizable:IAuthorizableIdentity whose authorization must be resolved.
Returns
tuple[frozenset[str], frozenset[str]]Effective permission names first, role names second.

Undocumented