-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
49 lines (49 loc) · 1.62 KB
/
Copy pathdatabase.rules.json
File metadata and controls
49 lines (49 loc) · 1.62 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
{
"rules": {
"students": {
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid",
"projects": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid"
}
}
},
"projects": {
".read": "auth != null",
"$projectId": {
".write": "auth != null && (!data.exists() || data.child('student/id').val() == auth.uid)",
".validate": "newData.hasChildren(['projectDetails', 'status', 'student'])"
}
},
"teachers": {
".read": "auth != null",
"$uid": {
".read": "auth != null",
".write": "auth != null && auth.uid == $uid",
".validate": "newData.hasChildren(['id', 'name', 'email'])"
}
},
"mentors": {
".read": "auth != null",
"$mentorId": {
".write": "auth != null && auth.uid == $mentorId",
"profile": {
".validate": "newData.hasChildren(['id', 'name', 'email', 'expertise'])"
},
"projects": {
".read": "auth != null",
".write": "auth != null && auth.uid == $mentorId"
}
}
},
"mentorship_requests": {
".read": "auth != null && (data.child('studentId').val() == auth.uid || data.child('mentorId').val() == auth.uid)",
"$requestId": {
".write": "auth != null && ((!data.exists() && newData.child('studentId').val() == auth.uid) || (data.exists() && data.child('mentorId').val() == auth.uid))",
".validate": "newData.hasChildren(['id', 'projectId', 'studentId', 'mentorId', 'status'])"
}
}
}
}