-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
23 lines (18 loc) · 806 Bytes
/
firestore.rules
File metadata and controls
23 lines (18 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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /groups/{groupId} {
allow create: if request.auth != null;
// Allow fetching a single group if you’re a member …
allow get: if request.auth != null
&& request.auth.uid in resource.data.members;
// … or allow listing groups only when the query includes inviteCode == some string
allow list: if request.auth != null
&& request.query.where('inviteCode', '==', request.query['inviteCode']);
allow update: if request.auth != null
&& request.auth.uid in resource.data.members;
allow delete: if request.auth != null
&& resource.data.createdBy == request.auth.uid;
}
}
}