Skip to content

Commit 4479322

Browse files
authored
Update README.md
1 parent d6c8265 commit 4479322

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,30 @@ REACT_APP_CONFIRMATION_EMAIL_REDIRECT=http://localhost:3000
107107
```
108108
REACT_APP_CONFIRMATION_EMAIL_REDIRECT=https://mydomain.com
109109
```
110+
111+
### Security Rules
112+
113+
```
114+
{
115+
"rules": {
116+
".read": false,
117+
".write": false,
118+
"users": {
119+
"$uid": {
120+
".read": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])",
121+
".write": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])"
122+
},
123+
".read": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])",
124+
".write": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])"
125+
},
126+
"messages": {
127+
".indexOn": ["createdAt"],
128+
"$uid": {
129+
".write": "data.exists() ? data.child('userId').val() === auth.uid : newData.child('userId').val() === auth.uid"
130+
},
131+
".read": "auth != null",
132+
".write": "auth != null",
133+
},
134+
}
135+
}
136+
```

0 commit comments

Comments
 (0)