Skip to content

Commit a8b02dc

Browse files
authored
Update README.md
1 parent a9648ea commit a8b02dc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ For Google Authentication & Firebase you need to use your own google-services.js
1616

1717
You may need to include an api key in your [manifest.xml](https://github.com/khammami/journal-app/blob/411291d3934ded74f1d1c4bfec80a900a321c2a8/app/src/main/AndroidManifest.xml#L29) for Fabric if you want or just remove it.
1818

19+
**Firestore rules I've used:**
20+
```
21+
match /databases/{database}/documents {
22+
match /users/{userId}/{document=**} {
23+
allow read, write: if request.auth.uid == userId;
24+
}
25+
26+
match /users/{userId}/posts/{postId} {
27+
allow write: if request.resource.data.updatedAt > resource.data.updatedAt;
28+
allow write: if !exists(/databases/$(database)/documents/users/$(request.auth.uid)/posts/$(request.resource.data.id))
29+
}
30+
}
31+
```
32+
1933
### Screenshots
2034
<img src="https://raw.githubusercontent.com/khammami/journal-app/master/release/screenshots/Screenshot_2018-07-01-16-23-44.png" width="150"> <img src="https://raw.githubusercontent.com/khammami/journal-app/master/release/screenshots/Screenshot_2018-07-01-16-23-33.png" width="150">
2135

0 commit comments

Comments
 (0)