forked from openedx/openedx-authz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroles.py
More file actions
68 lines (55 loc) · 2.09 KB
/
roles.py
File metadata and controls
68 lines (55 loc) · 2.09 KB
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
"""
Default roles and their associated permissions.
"""
from openedx_authz.api.data import RoleData
from openedx_authz.constants import permissions
# Library Roles and Permissions
# Define the associated permissions for each role
LIBRARY_ADMIN_PERMISSIONS = [
permissions.VIEW_LIBRARY,
permissions.MANAGE_LIBRARY_TAGS,
permissions.DELETE_LIBRARY,
permissions.EDIT_LIBRARY_CONTENT,
permissions.PUBLISH_LIBRARY_CONTENT,
permissions.REUSE_LIBRARY_CONTENT,
permissions.VIEW_LIBRARY_TEAM,
permissions.MANAGE_LIBRARY_TEAM,
permissions.CREATE_LIBRARY_COLLECTION,
permissions.EDIT_LIBRARY_COLLECTION,
permissions.DELETE_LIBRARY_COLLECTION,
]
LIBRARY_AUTHOR_PERMISSIONS = [
permissions.VIEW_LIBRARY,
permissions.MANAGE_LIBRARY_TAGS,
permissions.EDIT_LIBRARY_CONTENT,
permissions.PUBLISH_LIBRARY_CONTENT,
permissions.REUSE_LIBRARY_CONTENT,
permissions.VIEW_LIBRARY_TEAM,
permissions.CREATE_LIBRARY_COLLECTION,
permissions.EDIT_LIBRARY_COLLECTION,
permissions.DELETE_LIBRARY_COLLECTION,
]
LIBRARY_CONTRIBUTOR_PERMISSIONS = [
permissions.VIEW_LIBRARY,
permissions.MANAGE_LIBRARY_TAGS,
permissions.EDIT_LIBRARY_CONTENT,
permissions.REUSE_LIBRARY_CONTENT,
permissions.VIEW_LIBRARY_TEAM,
permissions.CREATE_LIBRARY_COLLECTION,
permissions.EDIT_LIBRARY_COLLECTION,
permissions.DELETE_LIBRARY_COLLECTION,
]
LIBRARY_USER_PERMISSIONS = [
permissions.VIEW_LIBRARY,
permissions.REUSE_LIBRARY_CONTENT,
permissions.VIEW_LIBRARY_TEAM,
]
LIBRARY_ADMIN = RoleData(external_key="library_admin", permissions=LIBRARY_ADMIN_PERMISSIONS)
LIBRARY_AUTHOR = RoleData(external_key="library_author", permissions=LIBRARY_AUTHOR_PERMISSIONS)
LIBRARY_CONTRIBUTOR = RoleData(external_key="library_contributor", permissions=LIBRARY_CONTRIBUTOR_PERMISSIONS)
LIBRARY_USER = RoleData(external_key="library_user", permissions=LIBRARY_USER_PERMISSIONS)
# Course Roles and Permissions
COURSE_STAFF_PERMISSIONS = [
permissions.MANAGE_ADVANCED_SETTINGS,
]
COURSE_STAFF = RoleData(external_key="course_staff", permissions=COURSE_STAFF_PERMISSIONS)