Skip to content

Commit a0a3cc0

Browse files
authored
Update README.md
1 parent d470afb commit a0a3cc0

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
@@ -109,3 +109,30 @@ REACT_APP_CONFIRMATION_EMAIL_REDIRECT=http://localhost:3000
109109
```
110110
REACT_APP_CONFIRMATION_EMAIL_REDIRECT=https://mydomain.com
111111
```
112+
113+
### Security Rules
114+
115+
```
116+
{
117+
"rules": {
118+
".read": false,
119+
".write": false,
120+
"users": {
121+
"$uid": {
122+
".read": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])",
123+
".write": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])"
124+
},
125+
".read": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])",
126+
".write": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])"
127+
},
128+
"messages": {
129+
".indexOn": ["createdAt"],
130+
"$uid": {
131+
".write": "data.exists() ? data.child('userId').val() === auth.uid : newData.child('userId').val() === auth.uid"
132+
},
133+
".read": "auth != null",
134+
".write": "auth != null",
135+
},
136+
}
137+
}
138+
```

0 commit comments

Comments
 (0)