forked from marijnh/Eloquent-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
46 lines (46 loc) · 2.24 KB
/
database.rules.json
File metadata and controls
46 lines (46 loc) · 2.24 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
{
"rules": {
"exercises": {
".read": "auth != null",
".write": "auth != null && root.child('users').child(auth.uid).child('status').val() == 'staff'"
},
"qnas": {
".read": "auth != null",
".write": "auth != null && root.child('users').child(auth.uid).child('status').val() == 'staff'"
},
"answers": {
".read": "auth != null && root.child('users').child(auth.uid).child('status').val() == 'staff'",
".write": "auth != null && root.child('users').child(auth.uid).child('status').val() == 'staff'",
"$githubName": {
".read": "auth != null && root.child('users').child(auth.uid).child('gitHubName').val() == $githubName",
".write": "auth != null && root.child('users').child(auth.uid).child('gitHubName').val() == $githubName"
}
},
"questions": {
".read": "auth != null && root.child('users').child(auth.uid).child('status').val() == 'staff'",
".write": "auth != null && root.child('users').child(auth.uid).child('status').val() == 'staff'",
"$githubName": {
".read": "auth != null && root.child('users').child(auth.uid).child('gitHubName').val() == $githubName",
".write": "auth != null && root.child('users').child(auth.uid).child('gitHubName').val() == $githubName",
"$questionName": {
".read": "auth != null && root.child('questions').child(root.child('users').child(auth.uid).child('gitHubName').val()).val() != null && root.child('questions').child(root.child('users').child(auth.uid).child('gitHubName').val()).child($questionName).val() != null && root.child('questions').child(root.child('users').child(auth.uid).child('gitHubName').val()).child($questionName).hasChildren()",
"$questionIndex": {
"upVoters" : {
"$upVoter": {
".write": "auth != null && root.child('users').child(auth.uid).child('gitHubName').val() == $upVoter"
}
}
}
}
}
},
"users": {
".read": "auth != null",
".write": "auth != null && root.child('users').child(auth.uid).child('status').val() == 'staff'",
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid"
}
}
}
}