-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathdatabase.rules.json
54 lines (54 loc) · 2.1 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
"rules": {
"db": {
"Project": {
".read": true,
".write": true
},
"Progress": {
".read": true,
".write": true
},
"Questions": {
".read": true,
".write": true
},
"Resources": {
".read": true,
".write": true
},
"Profiles": {
".read": "true",
"$uid": {
".read": "true",
".write": "auth!= null && $uid === auth.uid || root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists() || root.child('db/Profiles/' + auth.uid + '/roles/TEACHER').exists()",
"Username": {
".read": "auth!= null && $uid === auth.uid || root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists() || root.child('db/Profiles/' + auth.uid + '/roles/TEACHER').exists()"
}
}
},
"Untutorials": {
".read": "true",
"$project": {
".read": "true",
".write": "auth!= null && !data.exists() || (auth.uid === data.child('Author').val()) || root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists() || root.child('db/Profiles/' + auth.uid + '/roles/TEACHER').exists()"
}
},
"Classes": {
".read": "auth.uid != null && (root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists() || root.child('db/Profiles/' + auth.uid + '/roles/TEACHER').exists())",
"$class": {
".read": "auth.uid != null && (root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists() || root.child('db/Profiles/' + auth.uid + '/roles/TEACHER').exists())",
".write": "auth.uid != null && root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists()",
"$members": {
".read": "auth!= null && root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists() || (root.child('profiles/' + auth.uid + '/roles/TEACHER').exists() && data.child(auth.uid).exists())",
".write": "auth!= null && root.child('db/Profiles/' + auth.uid + '/roles/ADMIN').exists()"
}
}
},
"Projects": {
".read": true,
".write": true
}
}
}
}