-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.py
96 lines (87 loc) · 2.21 KB
/
constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Global Constants
@author: Hrishikesh Terdalkar
"""
###############################################################################
# Roles
ROLE_OWNER = "owner"
ROLE_ADMIN = "admin"
ROLE_CURATOR = "curator"
ROLE_ANNOTATOR = "annotator"
ROLE_QUERIER = "querier"
ROLE_MEMBER = "member"
ROLE_GUEST = "guest"
# --------------------------------------------------------------------------- #
# Permissions
PERMISSION_VIEW_UCP = "view_ucp"
PERMISSION_VIEW_CORPUS = "view_corpus"
PERMISSION_QUERY = "query"
PERMISSION_ANNOTATE = "annotate"
PERMISSION_CURATE = "curate"
PERMISSION_VIEW_ACP = "view_acp"
# --------------------------------------------------------------------------- #
# Role Definitions
ROLE_DEFINITIONS = [
{
"name": ROLE_GUEST,
"level": 1,
"description": "Guest",
"permissions": []
},
{
"name": ROLE_MEMBER,
"level": 5,
"description": "Member",
"permissions": [PERMISSION_VIEW_UCP, PERMISSION_VIEW_CORPUS]
},
{
"name": ROLE_QUERIER,
"level": 10,
"description": 'Querier',
"permissions": [PERMISSION_QUERY]
},
{
"name": ROLE_ANNOTATOR,
"level": 50,
"description": "Annotator",
"permissions": [PERMISSION_ANNOTATE],
},
{
"name": ROLE_CURATOR,
"level": 75,
"description": "Curator",
"permissions": [PERMISSION_ANNOTATE, PERMISSION_CURATE]
},
{
"name": ROLE_ADMIN,
"level": 100,
"description": "Administrator",
"permissions": [PERMISSION_VIEW_ACP]
},
{
"name": ROLE_OWNER,
"level": 1000,
"description": "Owner",
"permissions": [PERMISSION_VIEW_ACP]
},
]
###############################################################################
# File Type
FILE_TYPE_JSON = {
"value": "json",
"description": "JSON",
"extensions": ["json"]
}
FILE_TYPE_CSV = {
"value": "csv",
"description": "CSV",
"extensions": ["csv"]
}
FILE_TYPE_PLAINTEXT = {
"value": "plaintext",
"description": "Plain Text",
"extensions": ["txt"]
}
###############################################################################