-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
24 lines (24 loc) · 880 Bytes
/
firestore.rules
File metadata and controls
24 lines (24 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
rules_version = '2';
service cloud.firestore {
function isAuthenticated() {
return request.auth != null && request.auth.uid != null;
}
match /databases/{database}/documents {
match /tasks/{id} {
allow read, update, delete: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
match /taskLogs/{id} {
allow read, update, delete: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
match /profiles/{userId} {
allow read, update, delete: if isAuthenticated() && request.auth.uid == userId;
allow create: if isAuthenticated();
}
match /rewards/{reward} {
allow read, update, delete: if isAuthenticated() && request.auth.uid == resource.data.userId;
allow create: if isAuthenticated();
}
}
}