-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfirestore.rules
More file actions
27 lines (24 loc) · 845 Bytes
/
firestore.rules
File metadata and controls
27 lines (24 loc) · 845 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
27
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// users can read their own data
match /users/{userId} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if request.auth != null && request.auth.uid == userId;
}
// experiences can be read by anyone, but only created by authenticated users
match /experiences/{experienceId} {
allow read: if true; // anyone can read experiences
allow create: if request.auth != null;
allow update, delete: if request.auth != null &&
resource.data.hostId == request.auth.uid;
}
// cities and interests are public read-only
match /cities/{cityId} {
allow read: if true;
}
match /interests/{interestId} {
allow read: if true;
}
}
}