codenotary / immudb-py

immudb Python SDK
Apache License 2.0
45 stars 7 forks source link

Map Permissions to proper classes / enums #38

Closed Razikus closed 2 years ago

Razikus commented 2 years ago

Currently users of immudb-py have to map Permission and PermissionAction by themselves

Should be probably covered by SDK

class Permission(IntEnum):
    NONE = 0
    READ = 1
    READ_WRITE = 2
    ADMIN = 254
    SYS_ADMIN = 255
class PermissionAction(IntEnum):
    GRANT = 0
    REVOKE = 1
mabmayer commented 2 years ago

see tests/immu/test_permission.py:

from immudb.constants import PERMISSION_RW, PERMISSION_R
from immudb.grpc.schema_pb2 import GRANT, REVOKE

There are constants, but well hidden. We should change this.

Razikus commented 2 years ago

Great! I will add these to examples then