Skip to main content

A Bitwise Permission Handler

Project description

Perm-Banana

A package to enable easy permission creation inside Python.

test

How to use it?

from perm-banana import Permission, Check, banana

@banana
class MyPermission(Permission)
    can_read_messages = Check(Permission(0b1))
    can_write_messages = Check(Permission(0b10))
    basic_user = can_read_message | can_write_messages

user = MyPermission(0b11)
if user.basic_user:
    print("permission granted")
else:
    print("permission denied")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perm_banana-0.2.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

perm_banana-0.2.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file perm_banana-0.2.1.tar.gz.

File metadata

  • Download URL: perm_banana-0.2.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.7.11 Linux/5.8.0-1040-azure

File hashes

Hashes for perm_banana-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c66c8f790a197c97137a393fdb8a9f35dc5d58df64eca8f43f62d56e58b8e226
MD5 f92ceaf160be3d57b602d70c7550a80b
BLAKE2b-256 0c81540637871af5a860f56635b60edad156c271567cd55249431c11a569d0a4

See more details on using hashes here.

File details

Details for the file perm_banana-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: perm_banana-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.8 CPython/3.7.11 Linux/5.8.0-1040-azure

File hashes

Hashes for perm_banana-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1b3a861e0ab249ec5c11207053af927504c2207cadf1d223309eeb0053314a7
MD5 d2bc91541c6e74cd081560e033638e72
BLAKE2b-256 30158029e9c2325f92c759e94acd8ade83df94e9fa735c1374022107e07fd295

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page