-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
26 lines (23 loc) · 847 Bytes
/
Copy pathfirestore.rules
File metadata and controls
26 lines (23 loc) · 847 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
25
26
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Deny read/write by default
match /{document=**} {
allow read, write: if false;
}
// Enforce owner check for notes
match /users/{uid}/notes/{noteId} {
allow read, update, delete: if request.auth != null
&& request.auth.uid == uid
&& resource.data.ownerId == uid;
allow create: if request.auth != null
&& request.auth.uid == uid
&& request.resource.data.ownerId == uid;
}
// Public notes collection - client writes are blocked (Worker Admin only)
match /public_notes/{noteId} {
allow read: if true;
allow write, delete: if false;
}
}
}