backend-manager 2.3.9 → 2.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backend-manager",
3
- "version": "2.3.9",
3
+ "version": "2.3.10",
4
4
  "description": "Quick tools for developing Firebase functions",
5
5
  "main": "src/manager/index.js",
6
6
  "bin": {
@@ -3,7 +3,44 @@
3
3
  ///---backend-manager---///
4
4
  ///---version=0.0.0---///
5
5
 
6
- // Gathering rules
6
+ // Session rules
7
+ "sessions": {
8
+ ".read": false,
9
+ ".write": false,
10
+ "$room": {
11
+ ".read": "
12
+ (auth.uid != null && query.equalTo == auth.uid)
13
+ ",
14
+ ".write": false,
15
+ ".indexOn": ["uid"],
16
+ "$id": {
17
+ ".read": "
18
+ // Allowed if user is authenticated AND is the owner of the doc
19
+ (auth != null && auth.uid == data.child('uid').val())
20
+ // Allowed if uid is equal to the doc id [LEGACY FOR SOMIIBO]
21
+ || (auth != null && auth.uid == $id)
22
+ // Allowed if user is not authenticated AND is the doc has no owner
23
+ || (auth == null && (data.child('uid').val() == ''))
24
+ ",
25
+ ".write": "
26
+ // Allowed if the user is authenticated AND is the owner of the existing doc
27
+ (auth != null && auth.uid == data.child('uid').val())
28
+ // Allowed if the user is authenticated AND is the owner of the new doc
29
+ || (auth != null && auth.uid == newData.child('uid').val())
30
+ // Allowed if the user is authenticated AND is the owner of the existing doc
31
+ || (auth != null && auth.uid == data.child('uid').val())
32
+ // Allowed if uid is equal to the doc id [LEGACY FOR SOMIIBO]
33
+ || (auth != null && auth.uid == $id)
34
+ // Allowed if the existing doc has no owner
35
+ || (data.child('uid').val() == '')
36
+ // Allowed if the new doc has no owner
37
+ || (newData.child('uid').val() == '')
38
+ // Allowed if it's a delete
39
+ || (!newData.exists())
40
+ ",
41
+ }
42
+ }
43
+ },
7
44
  "gatherings": {
8
45
  ".read": false,
9
46
  ".write": false,