-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfirestore.rules
More file actions
23 lines (20 loc) · 759 Bytes
/
firestore.rules
File metadata and controls
23 lines (20 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /comments/{commentDocId} {
allow read, create, update: if true;
allow delete: if false;
}
// Allow public read access, but only content owners can write
match /comments/{commentDocId}/comments/{documents=**} {
allow read: if true
allow create: if request.auth.uid == request.resource.data.authorId;
allow update, delete: if request.auth.uid == resource.data.authorId;
}
match /comments/{commentDocId}/commentLikes/{documents} {
allow read: if true
allow create: if request.auth.uid == request.resource.data.userId;
allow delete: if request.auth.uid == resource.data.userId;
}
}
}