-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
37 lines (33 loc) · 1.07 KB
/
Copy pathfirestore.rules
File metadata and controls
37 lines (33 loc) · 1.07 KB
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
34
35
36
37
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Users collection
match /users/{uid} {
allow read: if true;
allow write: if request.auth != null && request.auth.uid == uid;
}
// Presence collection
match /presence/{uid} {
allow read: if true;
allow write: if request.auth != null && request.auth.uid == uid;
}
// Messages collection
match /messages/{messageId} {
allow read: if true;
allow create: if request.auth != null
&& request.resource.data.uid == request.auth.uid
&& request.resource.data.text is string
&& request.resource.data.text.size() <= 1000;
allow update, delete: if false;
}
// Work sessions collection
match /workSessions/{sessionId} {
allow read: if request.auth != null;
allow create: if request.auth != null
&& request.resource.data.uid == request.auth.uid;
allow update: if request.auth != null
&& resource.data.uid == request.auth.uid;
allow delete: if false;
}
}
}