forked from fireact-dev/main
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
29 lines (29 loc) · 1.03 KB
/
firestore.rules
File metadata and controls
29 lines (29 loc) · 1.03 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 {
match /{document=**} {
allow read, write: if false;
}
match /users/{userId} {
allow read, update, create: if request.auth.uid == userId;
}
match /users/{userId}/activities/{documents=**} {
allow read, create: if request.auth.uid == userId
}
match /plans/{planId} {
allow read: if true;
}
match /accounts/{accountId} {
allow read: if request.auth.uid != null && request.auth.uid in resource.data.access;
}
match /accounts/{accountId}/invoices/{invoiceId} {
allow read: if request.auth.uid != null && request.auth.uid in get(/databases/$(database)/documents/accounts/$(accountId)).data.admins;
}
match /taxes/{taxRateId} {
allow read: if true;
}
match /accounts/{accountId}/images/{imageId} {
allow read, create, update, delete: if request.auth.uid != null && request.auth.uid in get(/databases/$(database)/documents/accounts/$(accountId)).data.access;
}
}
}