-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirestore.rules
33 lines (33 loc) · 1.37 KB
/
firestore.rules
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
28
29
30
31
32
33
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /session/{document=**} {
allow read, write: if
request.auth.uid != null;
}
match /calls/{callId}/users/{document=**} {
allow create: if
request.auth.uid != null && request.auth.uid == request.resource.data.userUid;
allow read, list: if
request.auth.uid != null;
allow update: if
request.auth.uid != null && get(/databases/$(database)/documents/calls/$(callId)).data.hostId == request.auth.uid;
allow delete: if
request.auth.uid != null && (get(/databases/$(database)/documents/calls/$(callId)).data.hostId == request.auth.uid || request.auth.uid == resource.data.userUid);
}
match /calls/{callId}/p2p-descriptions/{descriptionId} {
allow create, update, delete: if
request.auth.uid != null && (request.auth.uid == request.resource.data.newerPeerUid || request.auth.uid == request.resource.data.olderPeerUid)
allow read, list: if
request.auth.uid != null
}
match /calls/{document} {
allow read: if
request.auth.uid != null;
allow create: if
request.auth.uid != null && request.auth.uid == request.resource.data.hostId;
allow update, delete: if
request.auth.uid != null && request.auth.uid == resource.data.hostId;
}
}
}