-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatabase.rules.json
40 lines (40 loc) · 1.76 KB
/
database.rules.json
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
{
"rules": {
"courses": {
".read": true,
"$courseId": {
".read": true,
".write": "auth != null && root.child('users/' + auth.uid + '/isAdmin').val() === true",
"history": {
".read": true,
".write": "auth != null && root.child('courses/' + $courseId + '/users/' + auth.uid + '/isTA').val() === true"
},
"users": {
"$userId": {
".read": "auth != null && (auth.uid === $userId || root.child('users/' + auth.uid + '/isAdmin').val() === true || root.child('courses/' + $courseId + '/users/' + auth.uid + '/isTA').val() === true)",
".write": "auth != null && (auth.uid === $userId || root.child('users/' + auth.uid + '/isAdmin').val() === true || root.child('courses/' + $courseId + '/users/' + auth.uid + '/isTA').val() === true)",
"isTA": {
".write": "auth != null && root.child('users/' + auth.uid + '/isAdmin').val() === true"
}
}
}
}
},
"queues": {
".read": true,
".write": "auth != null"
},
"users": {
"$userId": {
".read": "auth != null && (auth.uid === $userId || root.child('users/' + auth.uid + '/isAdmin').val() === true)",
".write": "auth != null && (auth.uid === $userId || root.child('users/' + auth.uid + '/isAdmin').val() === true)",
"isAdmin": {
".read": "auth != null && root.child('users/' + auth.uid + '/isAdmin').val() === true",
".write": "auth != null && root.child('users/' + auth.uid + '/isAdmin').val() === true"
}
},
".read": "auth != null && root.child('users/' + auth.uid + '/isAdmin').val() === true",
".write": "auth != null && root.child('users/' + auth.uid + '/isAdmin').val() === true"
}
}
}