Skip to main content

simple_module_sharing

A generic share table for simple_module apps: give a user, tenant role or registered subject view or edit access to one row of another module, with an optional expiry, without that module shipping a bespoke share model. It plugs into the framework's resource-scoped access (ResourcePolicy, OwnedResourcePolicy, RequiresResource), so detail routes, lists and counts all honour a share in SQL.

Install

pip install simple_module_sharing

Add simple_module_sharing to your host's dependencies; the [project.entry-points.simple_module] entry point is discovered automatically at boot. Run alembic upgrade heads to create sharing_resource_share.

Usage

Declare the resource type in the owning module and hand the policy a share_exists factory:

from sharing.core.policy import share_exists_for

NOTE_POLICY = OwnedResourcePolicy(
    Note.owner_id,
    bypass_perm=PERM_NOTES_MANAGE,
    share_exists=share_exists_for("notes.note", Note.id),
)


def register_resource_types(self, registry):
    registry.register(
        ResourceType(name="notes.note", policy=NOTE_POLICY, select_by_id=select_by_id(Note))
    )
Route Purpose Permission
POST /api/sharing/shares Grant or update a share sharing.share + policy can("share")
GET /api/sharing/shares?resource_type=&resource_id= Shares on one row sharing.share + policy can("share")
DELETE /api/sharing/shares/{id} Revoke (hard delete) sharing.share; granter, grantee or sharing.manage
GET /admin/sharing/ Admin list of every share in the tenant sharing.view

Shares are tenant-scoped, expired shares never match, and grantees are validated through registered subject providers; user recipients use the user directory. See docs/modules/sharing.md.

License

MIT

Metadata

Release files for simple-module-sharing 0.0.48

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-sharing 0.0.48
File Size Uploaded Provenance Actions
simple_module_sharing-0.0.48.tar.gz 44.2 kB With provenance Details for simple_module_sharing-0.0.48.tar.gz

Built distribution (wheel)

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

Total release size: 79.2 kB

Release files / simple_module_sharing-0.0.48.tar.gz

Download URL simple_module_sharing-0.0.48.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e1671cf47e93e2f42a11ac957c4d933bea55c5e24f4069e9b1d04e321f0f56e2
BLAKE2b-256 checksum
How to use checksums
651337c157cec327c673a22d1a072a257a2d04ff754c7c5302f42c14c4817043
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 19, 2026.

Transparency log

Release files / simple_module_sharing-0.0.48-py3-none-any.whl

Download URL simple_module_sharing-0.0.48-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29c1ba93e000298019158c39149fb5bce21c6818ceed4896fdcfd028124d7ffc
BLAKE2b-256 checksum
How to use checksums
995dd6dd0d38c3a6829f21a1eafe3a9651492b25a0484b340eaaedcc3e9b5e83
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 19, 2026.

Transparency log

Security for simple-module-sharing 0.0.48

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_sharing-0.0.48.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 19, 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.

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