Cithun
仿照 Linux 下的文件权限系统实现的权限管理系统。
特性
- 通过类似 Linux 下的文件权限系统的方式管理权限
- 支持用户组
- 支持用户组继承
Example
from arclet.cithun import Permission
from arclet.cithun.builtins import System
system = System()
with system.isolate("data"):
AUTH_1 = system.create_role("ROLE_AUTH_1", "AUTH_1")
AUTH_2 = system.create_role("ROLE_AUTH_2", "AUTH_2")
AUTH_3 = system.create_role("ROLE_AUTH_3", "AUTH_3")
AUTH_4 = system.create_role("ROLE_AUTH_4", "AUTH_4")
AUTH_5 = system.create_role("ROLE_AUTH_5", "AUTH_5")
system.inherit(AUTH_2, AUTH_1)
system.inherit(AUTH_3, AUTH_2)
system.inherit(AUTH_4, AUTH_3)
system.inherit(AUTH_5, AUTH_4)
alice = system.create_user("alice", "Alice")
bob = system.create_user("bob", "Bob")
carol = system.create_user("carol", "Carol")
system.inherit(alice, AUTH_1)
system.inherit(bob, AUTH_3)
system.inherit(carol, AUTH_5)
system.assign(AUTH_1, "app", Permission.AVAILABLE)
system.assign(AUTH_3, "app", Permission.VISIT)
system.assign(AUTH_5, "app.data", Permission.AVAILABLE | Permission.VISIT | Permission.MODIFY)
system.assign(AUTH_4, "app.secret", Permission.AVAILABLE | Permission.VISIT)
system.assign(alice, "app.data", Permission.MODIFY)
system.assign(bob, "app.config", Permission.MODIFY)
system.depend("app.data", AUTH_4, "app.secret", Permission.VISIT)
system.depend(bob, "app.config", alice, "app.data",Permission.VISIT)
Metadata
Release files for arclet-cithun 1.4.0
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 | |
|---|---|---|---|---|
| arclet_cithun-1.4.0.tar.gz | 38.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arclet_cithun-1.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.8 kB
Release files / arclet_cithun-1.4.0.tar.gz
| Download URL | arclet_cithun-1.4.0.tar.gz |
|---|---|
| Size | 38.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cafb4591c798f05906ce8827eaf19661bc3e2dae4d754db89c1351ab6fea275
|
|
BLAKE2b-256 checksum How to use checksums |
23d9674135ecdd03a1ddf8638b0522be39a1ec973cd3d6aafeef251bccae99f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.25.6 CPython/3.11.7 Windows/10
|
Release files / arclet_cithun-1.4.0-py3-none-any.whl
| Download URL | arclet_cithun-1.4.0-py3-none-any.whl |
|---|---|
| Size | 38.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b555c804d7b067e63c4fab90ff744be8a1d471569a0f265c9c3b4d39df333db2
|
|
BLAKE2b-256 checksum How to use checksums |
7ed2be3839aa49dc4834cbbea1b194ce0563f98654f24faf3c6f024003f2143e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.25.6 CPython/3.11.7 Windows/10
|
Security for arclet-cithun 1.4.0
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.