-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdatabase.rules.json
55 lines (55 loc) · 1.58 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
55
{
"rules": {
// Anyone can read, admins can write
"experts": {
".read": true,
".write": "root.child('admin/'+auth.uid).exists()"
},
"events": {
".read": true,
"$event": {
".write": "root.child('admin/'+auth.uid).exists() || data.child('leads/'+auth.uid).exists()"
}
},
"communities": {
".read": true,
"$community": {
".write": "root.child('admin/'+auth.uid).exists() || data.child('organizer').val() === auth.uid"
}
},
"missions": {
".read": true,
"$mission": {
".write": "root.child('admin/'+auth.uid).exists() || data.child('organizer').val() === auth.uid"
}
},
"resources": {
".read": true,
".write": "root.child('admin/'+auth.uid).exists()"
},
"users": {
// All user information is public!
".read": true,
"$user_id": {
// grants write access to the owner of this user account
// whose uid must exactly match the key ($user_id)
// or any admin
".write": "$user_id === auth.uid || root.child('admin/'+auth.uid).exists()"
}
},
"admin": {
// only let admins see or modify admins
".read": "root.child('admin/'+auth.uid).exists()",
".write": "root.child('admin/'+auth.uid).exists()"
},
"queues": {
// Anyone can write to a new queue item, only admins can read or modify
".read": "root.child('admin/'+auth.uid).exists()",
"$queueType": {
"$post": {
".write": "!data.exists() || root.child('admin/'+auth.uid).exists() "
}
}
}
}
}