-
Notifications
You must be signed in to change notification settings - Fork 2
/
firestore.rules
48 lines (48 loc) · 1.27 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /Users/{user} {
allow create: if true;
allow update: if request.auth.uid == resource.data.uid;
allow read: if request.auth.uid == resource.data.uid;
}
match /Posts/{post} {
allow create: if
request.auth.uid != null;
allow update, delete: if
request.auth.uid == resource.data.createdBy;
allow read: if true;
}
match /Images/{image} {
allow create: if
request.auth.uid != null;
allow read: if false;
}
match /Errors/{error} {
allow create: if true;
}
match /Posts-prod/{post} {
allow create: if
request.auth.uid != null;
allow update, delete: if
request.auth.uid == resource.data.createdBy;
allow read: if true;
}
match /Errors-prod/{error} {
allow create: if true;
}
match /Logs/{logs} {
allow create: if true;
}
match /Comments/{comment} {
allow create, update, delete: if
request.auth.uid != null;
allow read: if true;
}
match /Edits/{edit} {
allow create, update, delete: if
request.auth.token.admin == true;
allow read: if true;
}
}
}