forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroles.py
More file actions
29 lines (26 loc) · 916 Bytes
/
roles.py
File metadata and controls
29 lines (26 loc) · 916 Bytes
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
import graphene
class RoleEnums(graphene.Enum):
USER_READ = "user_read"
USER_WRITE = "user_write"
ADMIN = "admin"
SUPER_ADMIN = "super_admin"
@property
def description(self):
if self == RoleEnums.USER_READ:
return "A user who has been given access to view results"
elif self == RoleEnums.USER_WRITE:
return (
"A user who has been given access to run scans, and " "manage domains"
)
elif self == RoleEnums.ADMIN:
return (
"A user who has the same access as a user write account, "
"but can define new user write accounts"
)
elif self == RoleEnums.SUPER_ADMIN:
return (
"A user who has the same access as an admin, but can "
"define new admins"
)
else:
return "Another Role"