Skip to content

Commit 78cff82

Browse files
committed
test: add authz.policy file for tests
1 parent 07e8d44 commit 78cff82

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# ===== POLICIES (p) =====
2+
3+
# Platform-level permissions
4+
p, role:platform_admin, act:manage, *, allow
5+
6+
# Organization-level permissions
7+
p, role:org_admin, act:manage, lib:*, allow
8+
p, role:org_editor, act:edit, lib:*, allow
9+
10+
# Library-specific permissions
11+
p, role:library_author, act:edit, lib:*, allow
12+
p, role:library_reviewer, act:read, lib:*, allow
13+
p, role:editor, act:edit, lib:*, allow
14+
15+
# Report permissions
16+
p, role:report_viewer, act:read, report:*, allow
17+
18+
# Access restrictions and exceptions
19+
p, role:org_editor, act:edit, lib:restricted-content, deny
20+
p, role:org_admin, act:manage, lib:another-restricted-content, deny
21+
22+
23+
# ===== ROLE ASSIGNMENTS (g) =====
24+
25+
# Platform administrators
26+
g, user:admin, role:platform_admin, *
27+
28+
# Organization administrators
29+
g, user:alice, role:org_admin, org:OpenedX
30+
31+
# Organization editors
32+
g, user:bob, role:org_editor, org:MIT
33+
g, user:paul, role:editor, org:OpenedX
34+
35+
# Library authors
36+
g, user:mary, role:library_author, lib:math-basics
37+
g, user:john, role:library_author, lib:science-101
38+
39+
# Library reviewers
40+
g, user:sarah, role:library_reviewer, lib:math-basics
41+
42+
# Report viewers
43+
g, user:maria, role:report_viewer, org:OpenedX
44+
45+
46+
# ===== ACTION GROUPING (g2) =====
47+
48+
# manage implies edit, delete, read, write
49+
g2, act:manage, act:edit
50+
g2, act:manage, act:delete
51+
g2, act:edit, act:read
52+
g2, act:edit, act:write
53+
54+
# edit implies read, write
55+
g2, act:edit, act:read
56+
g2, act:edit, act:write

0 commit comments

Comments
 (0)