-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
29 lines (25 loc) · 1.06 KB
/
firestore.rules
File metadata and controls
29 lines (25 loc) · 1.06 KB
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 {
// Hanya Authorized User yang bisa lihat (Read) dan edit (Write) ltem favorit
match /Favorites/{document} {
allow create: if request.auth != null;
allow read, update, delete: if request.auth != null && request.auth.uid == resource.data.userId;
}
// Hanya Authorized User yang bisa lihat (Read) dan edit (Write) data payment
match /PaymentMethods/{document} {
allow create: if request.auth != null;
allow read, update, delete: if request.auth != null && request.auth.uid == resource.data.userId;
}
// Izin untuk membaca swmua item hotel, jadi semua orang bisa liat. tapi cuma Authorized user yang bisa write
match /Hotel/{document} {
allow read: if true;
allow write: if request.auth != null;
}
// Izin untuk membaca statistik, jadi semua orang bisa liat. tapi cuma Authorized user yang bisa write
match /Stats/{document} {
allow read: if true;
allow write: if request.auth != null;
}
}
}