-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfirestore.rules
More file actions
38 lines (32 loc) · 1.09 KB
/
firestore.rules
File metadata and controls
38 lines (32 loc) · 1.09 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
31
32
33
34
35
36
37
38
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Cards collection - public read, no write from client
match /cards/{cardId} {
allow read: if true;
allow write: if false; // Only admin/crawler can write
}
// Merchants collection - public read
match /merchants/{merchantId} {
allow read: if true;
allow write: if false;
}
// Plaid tokens - only accessible by Cloud Functions
match /plaid_tokens/{tokenId} {
allow read, write: if false; // Cloud Functions bypass rules
}
// User data - authenticated users only
match /users/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
match /wallet/{cardId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /spending/{spendingId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /settings/{settingId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
}
}