Permitronix
Permitronix is a Python permission management module that allows you to manage permission tables for users and objects.
Installation
Permitronix can be installed via pip:
pip install permitronix
Usage
Permitronix
The Permitronix class allows you to manage permission tables for objects. Here is an example of how to
use Permitronix:
from permitronix import Permitronix
from permitronix.permission_node import PermissionNode
from permitronix.permission_table import PermissionTable
# Create a permitronix instance
ptx = Permitronix({})
# Set a permission for an object
obj = "example"
with ptx.enter(obj) as v:
pt: PermissionTable = v.value
pt.set_permission(PermissionNode('regular_expressions_for_some_permissions_.*', 'scope_id:1145'))
# Get the permission table for an object
pt = ptx.get_permission_table(obj)
# Remove a permission table for an object
ptx.rem_permission_obj(obj)
# Check if a permission table exists for an object
exists = ptx.exists(obj)
Permission Table
The PermissionTable class allows you to define permission tables for users and objects. Here is an example of how to
create a permission table:
from permitronix import Permitronix
from permitronix.permission_node import PermissionNode
from permitronix.permission_table import PermissionTable
# Create a permitronix instance
ptx = Permitronix({})
# Create a permission table
pt = PermissionTable(ptx, 'data')
pt.set_permission(PermissionNode('regular_expressions_for_some_permissions_.*', 'scope_id:1145'))
Permission Node
A PermissionNode is a node in the permission tree. Each node has a name and a permission level. Here is an example of
how to create a permission node:
from permitronix.permission_level import PermissionLevel
from permitronix.permission_node import PermissionNode
# Create a permission node
pn = PermissionNode("admin", PermissionLevel("op:12"))
Contributing
We welcome contributions from anyone who is interested in improving this project. If you find any issues, bugs, or have suggestions for improvement, please feel free to open an issue or submit a pull request.
We will review your changes and provide feedback if necessary. Thank you for your contributions!
License
This source code is licensed under the MIT license and may be used for any purpose consistent with local law, provided
that the copyright notice is retained.
Metadata
Release files for Permitronix 1.1.3
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 | Actions |
|---|---|---|---|---|
| Permitronix-1.1.3.tar.gz | 5.9 kB | Without provenance | Details for Permitronix-1.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Permitronix-1.1.3-py3-none-any.whl | Python 3 | none | any | Details for Permitronix-1.1.3-py3-none-any.whl |
Total release size: 16.3 kB
Release files / Permitronix-1.1.3.tar.gz
| Download URL | Permitronix-1.1.3.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c8f057b29d1a8cec4d2676606beaa2d9be0cb60443c06c120b14964b75b8bd0d
|
|
BLAKE2b-256 checksum How to use checksums |
b4eee76bf6a62719eb611bc3bc939e90b9f867d0625addc2a6bfce5faa75c786
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / Permitronix-1.1.3-py3-none-any.whl
| Download URL | Permitronix-1.1.3-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12bcd0504d63c03caede55f7253c77075c809315298f9cc80f7d04b703de2597
|
|
BLAKE2b-256 checksum How to use checksums |
7c19162292c5fe72d888db1b27a56f08ea7a2439a0fbd8b23763fe8f3ea8e5da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Security for Permitronix 1.1.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.