-
Notifications
You must be signed in to change notification settings - Fork 0
/
firestore.rules
30 lines (29 loc) · 1.18 KB
/
firestore.rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read: if true;
allow create: if request.auth.uid == request.resource.data.uid;
allow update: if request.auth.uid == resource.data.uid && request.resource.data.uid == resource.data.uid;
allow delete: if request.auth.uid == resource.data.uid;
match /favoriteBooks/{favoriteBookId} {
allow read: if request.auth.uid == userId;
allow create: if request.auth.uid == request.resource.data.uid;
allow update: if request.auth.uid == resource.data.uid && request.resource.data.uid == resource.data.uid;
allow delete: if request.auth.uid == resource.data.uid;
}
}
match /{path=**}/reviews/{reviewId} {
allow read: if true;
allow create: if request.auth.uid == request.resource.data.uid;
allow update: if request.auth.uid == resource.data.uid && request.resource.data.uid == resource.data.uid;
allow delete: if request.auth.uid == resource.data.uid;
}
match /bookRanking/{document=**} {
allow read: if true;
}
match /newRelease/{document=**} {
allow read: if true;
}
}
}