-
Notifications
You must be signed in to change notification settings - Fork 12
/
firestore.rules
96 lines (96 loc) · 3.13 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
allow read;
allow update, delete: if request.auth.uid == userId;
allow create: if request.auth.uid != null;
}
match /users/{document=**} {
allow read, create, update, delete: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.role == 'Admin';
}
match /users/{userId}/notifications/{document=**} {
allow read, create, update, delete, write;
}
match /prompts/{document=**} {
allow read;
allow create, update, delete: if request.auth != null;
}
match /prompts/{promptId}/likes/{document=**} {
allow read, create, update, delete;
}
match /prompts/{promptId}/dislikes/{document=**} {
allow read, create, update, delete;
}
match /prompts/{promptId}/shares/{document=**} {
allow read, create, update;
}
match /prompts/{promptId}/comments/{document=**} {
allow read, create, update, delete, write;
}
match /prompts/{promptId}/visitors/{document=**} {
allow read, create, update, delete, write;
}
match /entries/{document=**} {
allow read;
allow create, update, delete: if request.auth != null;
}
match /entries/{entryId}/likes/{document=**} {
allow read, create, update, delete;
}
match /entries/{entryId}/dislikes/{document=**} {
allow read, create, update, delete;
}
match /entries/{entryId}/shares/{document=**} {
allow read, create, update;
}
match /entries/{entryId}/stats/{document=**} {
allow read, create, update;
}
match /entries/{entryId}/comments/{document=**} {
allow read, create, update, delete, write;
}
match /entries/{entryId}/visitors/{document=**} {
allow read, create, update, delete, write;
}
match /errors/{document=**} {
allow read, create, update, delete, write;
}
match /feedbacks/{document=**} {
allow read, create, update, delete, write;
}
match /reports/{document=**} {
allow read, create, update, delete, write;
}
match /cryptoTransactions/{document=**} {
allow read, create, write;
}
match /advertises/{document=**} {
allow read, create, update, delete, write;
}
match /advertises/{advertiseId}/visitors/{document=**} {
allow read, create, update, delete, write;
}
match /advertises/{advertiseId}/likes/{document=**} {
allow read, create, update, delete;
}
match /advertises/{advertiseId}/dislikes/{document=**} {
allow read, create, update, delete;
}
match /advertises/{advertiseId}/comments/{document=**} {
allow read, create, update, delete, write;
}
match /advertises/{advertiseId}/shares/{document=**} {
allow read, create, update, delete;
}
match /advertises/{advertiseId}/clicks/{document=**} {
allow read, create, update, delete;
}
match /advertises/{advertiseId}/impressions/{document=**} {
allow read, create, update, delete;
}
match /advertises/{advertiseId}/lastViews/{document=**} {
allow read, create, update, delete;
}
}
}