-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
44 lines (36 loc) · 1.23 KB
/
firestore.rules
File metadata and controls
44 lines (36 loc) · 1.23 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
38
39
40
41
42
43
44
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Materials: Public can read, Admins can do anything
match /materials/{materialId} {
allow read: if true;
allow write: if request.auth != null;
}
// Feedback: Public can create, Admins can read/delete
match /feedback/{feedbackId} {
allow create: if true;
allow read, delete: if request.auth != null;
allow update: if false; // No updates allowed
}
// Bug Reports: Public can create, Admins can read/delete
match /bug-reports/{reportId} {
allow create: if true;
allow read, delete: if request.auth != null;
allow update: if false; // No updates allowed
}
// Social Links: Public can read, Admins can do anything
match /social-links/{linkId} {
allow read: if true;
allow write: if request.auth != null;
}
// Analytics: Site stats and daily visits can be incremented by anyone
match /analytics/siteStats {
allow read: if true;
allow write: if true; // Allow incrementing visits
}
match /dailyVisits/{visitId} {
allow read: if true;
allow write: if true; // Allow creating and incrementing daily visits
}
}
}