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__ Declare the instance attribute slots reserved by this class.
Instance Variable __db Gateway used to build queries over the authorization tables.
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
orionis.orm.contracts.raw_builder.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:orionis.orm.contracts.query_builder.IQueryBuilderGateway used to build queries over the authorization tables.
Returns
NoneNo return value.
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
orionis.orm.contracts.raw_builder.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
orionis.orm.contracts.raw_builder.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:orionis.auth.contracts.IAuthorizableIdentity whose authorization must be resolved.
Returns
tuple[frozenset[str], frozenset[str]]Effective permission names first, role names second.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Gateway used to build queries over the authorization tables.