Skip to main content

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

  • Role and Permission SQLModel tables, seeded from module-registered defaults.
  • RequiresPermission("...") FastAPI dependency that honours both role-based and direct user-level grants (the framework also exposes require_permission(...) from auth.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}/edit and /permissions/users/{id}/edit.
  • register_permissions(self, registry) hook — every module declares its permission strings at boot via registry.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.35

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-module-permissions 0.0.35
File Size Uploaded Provenance
simple_module_permissions-0.0.35.tar.gz 27.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for simple-module-permissions 0.0.35
File Interpreter ABI Platform
simple_module_permissions-0.0.35-py3-none-any.whl Python 3 none any Details

Total release size: 56.7 kB

Release files / simple_module_permissions-0.0.35.tar.gz

Download URL simple_module_permissions-0.0.35.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
06addfcfaf05a51e0e8fc030cf7c05f95b98995a736f1690bb6ab53d729cfb44
BLAKE2b-256 checksum
How to use checksums
28e04972a53aac60ad01f2821c979ce2fa96886956a26df6508ead39e1a4e3e2
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 Oct 1, 2026.

Transparency log

Release files / simple_module_permissions-0.0.35-py3-none-any.whl

Download URL simple_module_permissions-0.0.35-py3-none-any.whl
Size 29.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c9b07c0f7987222af872372a3c9b6cf11f76968600f1f6b3d28c54b04442c19
BLAKE2b-256 checksum
How to use checksums
9bc641d81bdd08fd2eb24285b6cf953c09149b57ee5f6e85d255429908d8e3ed
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 Oct 1, 2026.

Transparency log

Security for simple-module-permissions 0.0.35

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.

Select from 2 files

Attestation for simple_module_permissions-0.0.35.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 Oct 1, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.0.35 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page