-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirestore.rules
More file actions
48 lines (40 loc) · 1.42 KB
/
firestore.rules
File metadata and controls
48 lines (40 loc) · 1.42 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
45
46
47
48
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// USERS
// Allow any authenticated user to read profiles (for the discover page).
// Allow a user to only write to their own profile.
match /users/{userId} {
allow read: if request.auth != null;
allow write: if request.auth.uid == userId;
}
// SKILLS: Only the user or the server (admin) can update their skill records
match /skills/{userId} {
allow read: if true; // public read allowed
allow write: if request.auth != null && request.auth.uid == userId;
}
// PROOFS: Skill verification proofs
match /proofs/{userId} {
allow read: if true;
allow write: if request.auth != null && request.auth.uid == userId;
}
// CREATIVE SHOWCASE
match /showcases/{userId} {
allow read: if true;
allow write: if request.auth != null && request.auth.uid == userId;
}
// FEEDBACK
match /feedback/{userId} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
// PUBLIC FEED (cached summaries / leaderboard)
match /publicFeed/{docId} {
allow read: if true;
allow write: if request.auth != null && request.auth.token.admin == true; // Only server or admin
}
// Optional: Only authenticated users can list collections
match /{document=**} {
allow list: if request.auth != null;
}
}
}