-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstorage.rules
More file actions
31 lines (25 loc) · 1014 Bytes
/
storage.rules
File metadata and controls
31 lines (25 loc) · 1014 Bytes
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
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Helper function to check if user is authenticated
function isAuthenticated() {
return request.auth != null;
}
// Milestone submissions folder
match /milestone_submissions/{allPaths=**} {
// Allow authenticated users to upload files (max 2MB)
// Only PDF and DOCX files allowed
allow create: if isAuthenticated() &&
request.resource.size < 2 * 1024 * 1024 &&
request.resource.contentType.matches('application/pdf|application/vnd.openxmlformats-officedocument.wordprocessingml.document');
// Allow authenticated users to read their own uploads
allow read: if isAuthenticated();
// No updates or deletes allowed (prevent tampering with submissions)
allow update, delete: if false;
}
// Default deny all other paths
match /{allPaths=**} {
allow read, write: if false;
}
}
}