-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirebase.rules
40 lines (32 loc) · 1.26 KB
/
firebase.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
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /users/{userId} {
// Allow authenticated users to read any user's data
allow read: if request.auth != null;
// Allow authenticated users to write only their own data
allow write: if request.auth != null && request.auth.uid == userId;
}
match /challenges/{challengeId} {
// Allow authenticated users to read/write challenges
allow read: if request.auth != null;
allow write: if request.auth != null;
match /messages/{messageId} {
// Allow authenticated users to read messages
allow read: if request.auth != null;
// Allow authenticated users to write messages
allow write: if request.auth != null;
}
match /auditorApplications/{applicationId} {
// Allow authenticated users to write auditor applications
allow write: if request.auth != null;
}
}
match /notifications/{notificationId} {
// Allow authenticated users to read notifications
allow read: if request.auth != null;
// Allow only the owner to write notifications
allow write: if request.auth != null && request.auth.uid == resource.data.owner;
}
}
}