Skip to content

Commit 29fe857

Browse files
authored
Update README.md
1 parent 8ec7368 commit 29fe857

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

0 commit comments

Comments
 (0)