aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/resource_manager.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/wqflask/wqflask/resource_manager.py b/wqflask/wqflask/resource_manager.py
index 330600ed..7f4718f0 100644
--- a/wqflask/wqflask/resource_manager.py
+++ b/wqflask/wqflask/resource_manager.py
@@ -2,7 +2,7 @@ import redis
import json
import functools
-from enum import Enum
+from enum import Enum, unique
@@ -23,8 +23,18 @@ class OrderedEnum(Enum):
return NotImplemented
+@unique
+class DataRole(OrderedEnum):
+ NO_ACCESS = "no-access"
+ VIEW = "view"
+ EDIT = "edit"
+@unique
+class AdminRole(OrderedEnum):
+ NOT_ADMIN = "not-admin"
+ EDIT_ACCESS = "edit-access"
+ EDIT_ADMINS = "edit-admins"
def get_user_membership(conn: redis.Redis, user_id: str,
group_id: str) -> Dict: