-
Notifications
You must be signed in to change notification settings - Fork 0
/
firestore.rules
32 lines (32 loc) · 1.23 KB
/
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
29
30
31
32
rules_version = '2';
service cloud.firestore {
function isAuthenticated() {
return request.auth != null && request.auth.uid != null;
}
match /databases/{database}/documents {
match /tasks/{id}/{document=**} {
allow read, write: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
match /taskLogs/{id}/{document=**} {
allow read, write: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
match /profiles/{userId}/{document=**} {
allow read, write: if isAuthenticated() && request.auth.uid == userId;
allow create: if isAuthenticated();
}
match /rewards/{reward}/{document=**} {
allow read, write: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
match /goals/{goal}/{document=**} {
allow read, write: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
match /quests/{quest}/{document=**} {
allow read, write: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
}
}