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 DatabasePermissionRepository(IPermissionRepository): (source)
Constructor: DatabasePermissionRepository(db)
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 | __direct |
Build the direct-permission arm of the authorization statement. |
| Method | __init__ |
Initialise the repository with the model-less query gateway. |
| Method | __role |
Build inherited permissions constrained to the current owner's roles. |
| Method | __roles |
Build the role arm of the authorization statement. |
| Async Method | load |
Load the permissions and roles owned by an identity. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | __db |
Undocumented |
Build the direct-permission arm of the authorization statement.
| Parameters | |
modelstr | Polymorphic type stored in the pivot table. |
modelobject | Identifier stored in the pivot table. |
| Returns | |
IRawQueryBuilder | Query exposing direct permission names and their kind. |
Initialise the repository with the model-less query gateway.
| Parameters | |
db:IQueryBuilder | Gateway used to build queries over the authorization tables. |
| Returns | |
None | The repository keeps only the injected gateway. |
Build inherited permissions constrained to the current owner's roles.
| Parameters | |
modelstr | Stable polymorphic owner type. |
modelobject | Canonical identifier of the owner. |
| Returns | |
IRawQueryBuilder | Query exposing permissions from roles attached in this statement. |
Build the role arm of the authorization statement.
| Parameters | |
modelstr | Polymorphic type stored in the pivot table. |
modelobject | Identifier stored in the pivot table. |
| Returns | |
IRawQueryBuilder | Query exposing role names tagged with their authorization kind. |
IAuthorizable) -> tuple[ frozenset[ str], frozenset[ str]]:
(source)
¶