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.
  • Direct user-level grants feed the framework's permission resolution through a grant source, so simple_module_hosting.auth.permissions.RequiresPermission honours them.
  • Provider-neutral admin UI for role permission mappings and direct user grants at /admin/permissions/; role and user editors live at /admin/permissions/roles/{id}/edit and /admin/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.access.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 simple_module_hosting.auth.permissions import RequiresPermission

router = APIRouter()


@router.get("/orders", dependencies=[Depends(RequiresPermission("orders.read"))])
async def list_orders(): ...

Admin flow: open /admin/permissions/ to edit role permission mappings or direct user grants. Users manages local role membership; OIDC and Keycloak manage membership in the identity provider.

Depends on

  • simple_module_core, simple_module_db, simple_module_hosting (Users is optional)

License

MIT — see LICENSE.

Metadata

Release files for simple-module-permissions 0.0.51

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.51
File Size Uploaded Provenance Actions
simple_module_permissions-0.0.51.tar.gz 50.2 kB With provenance Details for simple_module_permissions-0.0.51.tar.gz

Built distribution (wheel)

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

Total release size: 93.0 kB

Release files / simple_module_permissions-0.0.51.tar.gz

Download URL simple_module_permissions-0.0.51.tar.gz
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3a8ca8f3801ab748ca1cb9bdda8f134beb984d30c741275459dd9840df44e8e7
BLAKE2b-256 checksum
How to use checksums
246922cd102a79f7de7d8448fbb1c6cd90d0519c04bf970cc4609ca12f653e40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

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

Download URL simple_module_permissions-0.0.51-py3-none-any.whl
Size 42.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62cc324ee77aba6ef846836229a4108783542ebe46cc27d0279f19cd49c444ea
BLAKE2b-256 checksum
How to use checksums
362c38ff54b1afc33f11afbbf0c1c917a65ab6e9f955b1a1d9a1b300f80ed4e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 29, 2026.

Transparency log

Security for simple-module-permissions 0.0.51

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for simple_module_permissions-0.0.51.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 Nov 29, 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.51 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