-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
25 lines (22 loc) · 806 Bytes
/
Copy pathfirestore.rules
File metadata and controls
25 lines (22 loc) · 806 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users can only access their own data
match /users/{userId} {
// Allow read/write only if authenticated and accessing own data
allow read, write: if request.auth != null && request.auth.uid == userId;
// Config subcollection (stores salt)
match /config/{document=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// Passwords subcollection (stores encrypted password entries)
match /passwords/{passwordId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
}
// Deny all other access
match /{document=**} {
allow read, write: if false;
}
}
}