forked from maxamillion32/ionic2-neighbors
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.json
More file actions
108 lines (108 loc) · 3.97 KB
/
rules.json
File metadata and controls
108 lines (108 loc) · 3.97 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
"rules": {
".read":"false",
".write": "false",
"admins": {
".read":"auth != null",
".write":"false"
},
"public_rooms":{
".read":"false",
".write":"false",
"$groupId":{
".read":"(auth != null) && (root.child('groups/'+$groupId+'/members/'+auth.uid).exists())",
".write":"(auth != null) && (root.child('admins/'+$groupId+'/'+auth.uid).exists())",
}
},
"board_rooms":{
".read":"false",
".write":"false",
"$groupId":{
".read":"(auth != null) && (root.child('groups/'+$groupId+'/members/'+auth.uid).exists())",
".write":"(auth != null) && (root.child('admins/'+$groupId+'/'+auth.uid).exists())",
}
},
"public_messages":{
".read":"false",
".write":"false",
"$groupId":{
".read":"root.child('public_rooms/'+root.child('users/'+auth.uid+'/member_of').val()+'/'+$groupId).exists()",
".write":"root.child('public_rooms/'+root.child('users/'+auth.uid+'/member_of').val()+'/'+$groupId).exists()"
}
},
"board_messages":{
".read":"false",
".write":"false",
"$groupId":{
".read":"root.child('board_rooms/'+root.child('users/'+auth.uid+'/member_of').val()+'/'+$groupId).exists()",
".write":"root.child('board_rooms/'+root.child('users/'+auth.uid+'/member_of').val()+'/'+$groupId).exists()"
}
},
"private_rooms":{
".read":"false",
".write":"false",
"$groupId":{
".read":"false",
".write":"false",
"$userId":{
".read":"(auth != null) && ($userId===auth.uid)",
".write":"(auth != null) && (root.child('groups/'+$groupId+'/members/'+auth.uid).exists())",
}
}
},
"private_messages":{
".read":"false",
".write":"false",
"$groupId":{
".read":"root.child('private_rooms/'+root.child('users/'+auth.uid+'/member_of').val()+'/'+auth.uid+'/'+$groupId).exists()",
".write":"root.child('private_rooms/'+root.child('users/'+auth.uid+'/member_of').val()+'/'+auth.uid+'/'+$groupId).exists()"
}
},
"users": {
".read": "auth != null",
"$userId": {
// Only authenticated user can read and make chanages on it's own data (auth.id equal to $userId)
".read": "(auth != null) && ((auth.uid === $userId)||(root.child('groups/'+data.child('member_of').val()+'/members/'+auth.uid).exists()))",
".write": "(auth != null) && ((auth.uid === $userId) || (!data.child('member_of').exists() && root.child('admins/'+newData.child('member_of').val()+'/'+auth.uid).exists()))",
"member_of": {
".validate":"root.child('groups/'+newData.val()).exists()"}
}
},
"groups":{
".read":"auth != null",
".write":"false",
"$groupId":{
"members":{
".read":"auth != null",
".write":"(auth != null) && (root.child('admins/'+$groupId+'/'+auth.uid).exists())" }
}
},
"events":{
"$groupId": {
".read":"(auth != null) && (root.child('groups/'+$groupId+'/members/'+auth.uid).exists())",
".write":"(auth != null) && (root.child('admins/'+$groupId+'/'+auth.uid).exists())",
"$eventId":{
".validate":"root.child('groups/'+$groupId).exists()",
"user_id":{".validate":"(auth != null) && (root.child('admins/'+$groupId+'/'+auth.uid).exists())"}
}
}
},
"invite":{
"$groupId": {
".read":"(auth != null)",
".write":"(auth != null)",
"$userId":{
".read":"(auth != null) && ($userId===auth.uid)",
".write":"(auth != null) && ($userId===auth.uid)",
".validate":"root.child('groups/'+$groupId).exists() && root.child('users/'+$userId).exists()"
}
}
},
"utilities":{
"$groupId": {
".read":"(auth != null) && (root.child('groups/'+$groupId+'/members/'+auth.uid).exists())",
".write":"(auth != null) && (root.child('admins/'+$groupId+'/'+auth.uid).exists())"
}
}
}
}