simple_module_permissions
Role-based access control (RBAC) for simple_module apps. Users get roles, roles carry permissions, and route handlers declare required permissions at the decorator or dependency layer.
Pre-wired into any app scaffolded with smpy new.
Install
pip install simple_module_permissions
What it provides
RoleandPermissionSQLModel tables, seeded from module-registered defaults.RequiresPermission("...")FastAPI dependency that honours both role-based and direct user-level grants (the framework also exposesrequire_permission(...)fromauth.deps).- Admin UI for assigning roles/permissions to users, reached through the users admin area at
/users/admin; role and user editors live at/permissions/roles/{id}/editand/permissions/users/{id}/edit. register_permissions(self, registry)hook — every module declares its permission strings at boot viaregistry.add_group(...); the registry dedupes and persists them.
Usage
Declare permissions at module boot:
# modules/orders/orders/module.py
from simple_module_core.permissions import PermissionRegistry
class OrdersModule(ModuleBase):
meta = ModuleMeta(name="orders")
def register_permissions(self, registry: PermissionRegistry) -> None:
registry.add_group("Orders", ["orders.read", "orders.write"])
Guard a route:
from fastapi import APIRouter, Depends
from permissions.deps import RequiresPermission # type: ignore[import-not-found]
router = APIRouter()
@router.get("/orders", dependencies=[Depends(RequiresPermission("orders.read"))])
async def list_orders(): ...
Admin flow: navigate to /users/admin, create a role, assign permissions, assign the role to users.
Depends on
simple_module_core,simple_module_db,simple_module_hosting,simple_module_users
License
MIT — see LICENSE.
Metadata
Release files for simple-module-permissions 0.0.34
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| simple_module_permissions-0.0.34.tar.gz | 27.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_module_permissions-0.0.34-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 56.8 kB
Release files / simple_module_permissions-0.0.34.tar.gz
| Download URL | simple_module_permissions-0.0.34.tar.gz |
|---|---|
| Size | 27.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7fd104ea8439b2a93f50e9e30a9905c39fe357eed455be6dc92f518786b0cd3b
|
|
BLAKE2b-256 checksum How to use checksums |
94260f65495043daec2cbf82b8fda1deaefadd413f8cb3b8d2e22691eff4efcb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logRelease files / simple_module_permissions-0.0.34-py3-none-any.whl
| Download URL | simple_module_permissions-0.0.34-py3-none-any.whl |
|---|---|
| Size | 29.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d055ab48eac3d61fc1e43b7f7a2219b9dfe46033df717e4da6a7aece93ec34a9
|
|
BLAKE2b-256 checksum How to use checksums |
b4fbe001d810407c7ff823136736927ca4d6d5d297e26d7ff36c7f0c65b224ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logSecurity for simple-module-permissions 0.0.34
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for simple_module_permissions-0.0.34.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.