]> BookStack Code Mirror - bookstack/blob - dev/docs/permission-scenario-testing.md
Added additional entity_role_permission scenario tests
[bookstack] / dev / docs / permission-scenario-testing.md
1 # Permission Scenario Testing
2
3 Due to complexity that can arise in the various combinations of permissions, this document details scenarios and their expected results.
4
5 Test cases are written ability abstract, since all abilities should act the same in theory. Functional test cases may test abilities separate due to implementation differences.
6
7 ## Cases
8
9 ### Entity Role Permissions
10
11 These are tests related to entity-level role-specific permission overrides.
12
13 #### test_01_explicit_allow
14
15 - Page permissions have inherit disabled.
16 - Role A has entity allow page permission.
17 - User has Role A.
18
19 User should have page permission.
20
21 #### test_02_explicit_deny
22
23 - Page permissions have inherit disabled.
24 - Role A has entity deny page permission.
25 - User has Role A.
26
27 User denied page permission.
28
29 #### test_03_same_level_conflicting
30
31 - Page permissions have inherit disabled.
32 - Role A has entity allow page permission.
33 - Role B has entity deny page permission.
34 - User has both Role A & B.
35
36 User should have page permission. 
37 Explicit grant overrides entity deny at same level.
38
39 #### test_20_inherit_allow
40
41 - Page permissions have inherit enabled.
42 - Chapter permissions has inherit disabled.
43 - Role A has entity allow chapter permission.
44 - User has both Role A.
45
46 User should have page permission.
47
48 #### test_21_inherit_deny
49
50 - Page permissions have inherit enabled.
51 - Chapter permissions has inherit disabled.
52 - Role A has entity deny chapter permission.
53 - User has both Role A.
54
55 User denied page permission.
56
57 #### test_22_same_level_conflict_inherit 
58
59 - Page permissions have inherit enabled.
60 - Chapter permissions has inherit disabled.
61 - Role A has entity deny chapter permission.
62 - Role B has entity allow chapter permission.
63 - User has both Role A & B.
64
65 User should have page permission.
66
67 #### test_30_child_inherit_override_allow
68
69 - Page permissions have inherit enabled.
70 - Chapter permissions has inherit disabled.
71 - Role A has entity deny chapter permission.
72 - Role A has entity allow page permission.
73 - User has Role A.
74
75 User should have page permission.
76
77 #### test_31_child_inherit_override_deny
78
79 - Page permissions have inherit enabled.
80 - Chapter permissions has inherit disabled.
81 - Role A has entity allow chapter permission.
82 - Role A has entity deny page permission.
83 - User has Role A.
84
85 User denied page permission.