-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfirestore.rules
More file actions
30 lines (24 loc) · 1.06 KB
/
firestore.rules
File metadata and controls
30 lines (24 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
30
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Authenticated Users: Can manage their own profile and payment requests.
match /users/{userId} {
// Only the authenticated user can access their own user document.
allow read, write: if request.auth != null && request.auth.uid == userId;
// Payment requests subcollection for authenticated users.
match /paymentRequests/{paymentRequestId} {
// Only the user who owns this subcollection can manage their payment requests.
allow read, create, update, delete: if request.auth != null && request.auth.uid == userId;
}
}
// Public Payment Requests: For anonymous users.
match /publicPaymentRequests/{paymentRequestId} {
// Anyone can read a single public payment request.
allow get: if true;
// Anyone can create a public payment request.
allow create: if request.auth == null;
// Nobody can list, update, or delete public requests.
allow list, update, delete: if false;
}
}
}