-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestore.rules
32 lines (27 loc) · 1003 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
29
30
31
32
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read, write: if request.auth.uid == userId;
match /tasks/{taskID} {
allow read, delete: if request.auth.uid == userId
allow create, update: if request.auth.uid == userId && request.resource.data.userId == userId;
}
match /projects/{projectID} {
allow read, delete: if request.auth.uid == userId
allow create, update: if request.auth.uid == userId && request.resource.data.userId == userId;
match /tasks/{taskID} {
allow read, delete: if request.auth.uid == userId
allow create, update: if request.auth.uid == userId && request.resource.data.userId == userId;
}
}
}
// For collection group
match /{path=**}/tasks/{taskId} {
allow read: if request.auth.uid == resource.data.userId;
}
match /{document=**} {
allow read, write: if false;
}
}
}