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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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