-
Notifications
You must be signed in to change notification settings - Fork 4
/
firestore.rules
28 lines (28 loc) · 916 Bytes
/
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
service cloud.firestore {
match /databases/{database}/documents {
// Allow read for authenticated users with 'manager' role
// Only users with 'admin' role can write to db
// Users with 'manager' role can write to Checkins subcollections
match /packs/{document=**} {
allow read: if request.auth.token.manager;
allow write: if request.auth.token.admin;
}
match /clients/{client} {
allow read: if request.auth.token.manager;
allow write: if request.auth.token.admin;
match /checkins/{checkin} {
allow read, write: if request.auth.token.manager;
}
}
match /payments/{payment} {
allow read: if request.auth.token.manager;
allow write: if request.auth.token.admin;
}
match /charges/{payment} {
allow read, write: if request.auth.token.admin;
}
match /{document=**} {
allow read, write: if false;
}
}
}