-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
20 lines (18 loc) · 824 Bytes
/
firestore.rules
File metadata and controls
20 lines (18 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Allow authenticated users to read/write their own operations
match /operations/{operationId} {
allow read, write: if request.auth != null && request.auth.uid == resource.data.userId;
allow create: if request.auth != null && request.auth.uid == request.resource.data.userId;
// Allow access to operation messages subcollection
match /messages/{messageId} {
allow read, write: if request.auth != null && get(/databases/$(database)/documents/operations/$(operationId)).data.userId == request.auth.uid;
}
}
// Allow authenticated users to read/write test documents (for debugging)
match /test/{testId} {
allow read, write: if request.auth != null;
}
}
}