Skip to content

Commit 51bfa39

Browse files
authored
Update README.md
1 parent 480c493 commit 51bfa39

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,30 @@ REACT_APP_CONFIRMATION_EMAIL_REDIRECT=http://localhost:3000
116116
```
117117
REACT_APP_CONFIRMATION_EMAIL_REDIRECT=https://mydomain.com
118118
```
119+
120+
### Security Rules
121+
122+
```
123+
{
124+
"rules": {
125+
".read": false,
126+
".write": false,
127+
"users": {
128+
"$uid": {
129+
".read": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])",
130+
".write": "$uid === auth.uid || root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])"
131+
},
132+
".read": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])",
133+
".write": "root.child('users/'+auth.uid).child('roles').hasChildren(['ADMIN'])"
134+
},
135+
"messages": {
136+
".indexOn": ["createdAt"],
137+
"$uid": {
138+
".write": "data.exists() ? data.child('userId').val() === auth.uid : newData.child('userId').val() === auth.uid"
139+
},
140+
".read": "auth != null",
141+
".write": "auth != null",
142+
},
143+
}
144+
}
145+
```

0 commit comments

Comments
 (0)