forked from ruxailab/RUXAILAB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
73 lines (65 loc) · 2.37 KB
/
Copy pathdatabase.rules.json
File metadata and controls
73 lines (65 loc) · 2.37 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
69
70
71
72
73
{
"rules": {
"focusGroupSessions": {
"$studyId": {
".read": "auth != null",
"status": { ".write": "auth != null" },
"currentTopicIndex": { ".write": "auth != null" },
"facilitatorId": { ".write": "auth != null" },
"sessionId": { ".write": "auth != null" },
"startedAt": { ".write": "auth != null" },
"endedAt": { ".write": "auth != null" },
"lastUpdate": { ".write": "auth != null" },
"currentPrompt": { ".write": "auth != null" },
"currentStimulus": { ".write": "auth != null" },
"timer": { ".write": "auth != null" },
"consents": {
"$uid": {
".write": "auth != null && auth.uid === $uid"
}
},
"notes": {
"$uid": {
".write": "auth != null && auth.uid === $uid"
}
},
"participants": {
"$uid": {
".write": "auth != null && auth.uid === $uid"
}
},
"messages": {
"$topicId": {
".write": "auth != null"
}
},
"recordings": {
"$uid": {
".write": "auth != null && auth.uid === $uid"
}
}
}
},
// A separate top-level path, deliberately NOT nested under
// focusGroupSessions/$studyId — see the comment on backroomPath in
// useFocusGroupSession.js for why: RTDB read grants cascade downward
// from an ancestor and can't be revoked by a stricter rule on a
// descendant, so a subtree nested under a broadly-readable parent can
// never actually be read-private. This path is its own subtree, so its
// .read rule is the only word on who can read it.
"focusGroupBackroom": {
"$studyId": {
".read": "auth != null && (root.child('focusGroupSessions/' + $studyId + '/participants/' + auth.uid + '/accessLevel').val() === 0 || root.child('focusGroupSessions/' + $studyId + '/participants/' + auth.uid + '/accessLevel').val() === 3)",
".write": "auth != null && (root.child('focusGroupSessions/' + $studyId + '/participants/' + auth.uid + '/accessLevel').val() === 0 || root.child('focusGroupSessions/' + $studyId + '/participants/' + auth.uid + '/accessLevel').val() === 3)"
}
},
"rooms": {
".read": true,
".write": true
},
"calls": {
".read": true,
".write": true
}
}
}