forked from alexanderkholodov1/MunHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.rules.json
More file actions
46 lines (39 loc) · 3.41 KB
/
Copy pathdatabase.rules.json
File metadata and controls
46 lines (39 loc) · 3.41 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": {
"users": {
"$uid": {
".read": "auth != null && (auth.uid === $uid || root.child('users').child(auth.uid).child('role').val() === 'admin')",
".write": "auth != null && (auth.uid === $uid || root.child('users').child(auth.uid).child('role').val() === 'admin')"
},
".read": "auth != null && root.child('users').child(auth.uid).child('role').val() === 'admin'"
},
"profiles": {
".read": true,
"$profileId": {
".read": "data.child('visibility').val() !== 'private' || (auth != null && (data.child('ownerUid').val() === auth.uid || data.child('sharedWith/' + auth.uid).exists() || root.child('users').child(auth.uid).child('role').val() === 'admin'))",
".write": "auth != null && (data.child('ownerUid').val() === auth.uid || data.child('sharedWith/' + auth.uid).val() === 'edit' || root.child('users').child(auth.uid).child('role').val() === 'admin' || !data.exists())",
"sessions": {
"$sessionId": {
".read": "root.child('profiles').child($profileId).child('visibility').val() !== 'private' || (auth != null && (root.child('profiles').child($profileId).child('ownerUid').val() === auth.uid || root.child('profiles').child($profileId).child('sharedWith/' + auth.uid).exists() || root.child('users').child(auth.uid).child('role').val() === 'admin'))",
".write": "auth != null && (root.child('profiles').child($profileId).child('ownerUid').val() === auth.uid || root.child('profiles').child($profileId).child('sharedWith/' + auth.uid).val() === 'edit' || root.child('users').child(auth.uid).child('role').val() === 'admin')"
}
},
"realtime": {
".indexOn": ["ts"],
".read": "root.child('profiles').child($profileId).child('visibility').val() !== 'private' || (auth != null && (root.child('profiles').child($profileId).child('ownerUid').val() === auth.uid || root.child('profiles').child($profileId).child('sharedWith/' + auth.uid).exists() || root.child('users').child(auth.uid).child('role').val() === 'admin'))",
".write": "auth != null && (root.child('profiles').child($profileId).child('ownerUid').val() === auth.uid || root.child('profiles').child($profileId).child('sharedWith/' + auth.uid).val() === 'edit' || root.child('users').child(auth.uid).child('role').val() === 'admin')"
},
"latest": {
".read": "root.child('profiles').child($profileId).child('visibility').val() !== 'private' || (auth != null && (root.child('profiles').child($profileId).child('ownerUid').val() === auth.uid || root.child('profiles').child($profileId).child('sharedWith/' + auth.uid).exists() || root.child('users').child(auth.uid).child('role').val() === 'admin'))",
".write": "auth != null && (root.child('profiles').child($profileId).child('ownerUid').val() === auth.uid || root.child('profiles').child($profileId).child('sharedWith/' + auth.uid).val() === 'edit' || root.child('users').child(auth.uid).child('role').val() === 'admin')"
}
}
},
"organizations": {
"$orgId": {
".read": "auth != null && (data.child('owner').val() === auth.uid || data.child('members/' + auth.uid).exists() || root.child('users').child(auth.uid).child('role').val() === 'admin')",
".write": "auth != null && (data.child('owner').val() === auth.uid || root.child('users').child(auth.uid).child('role').val() === 'admin' || !data.exists())"
}
}
}
}