-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
31 lines (29 loc) · 1.35 KB
/
storage.rules
File metadata and controls
31 lines (29 loc) · 1.35 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
rules_version = '2';
// Craft rules based on data in your Firestore database
// allow write: if firestore.get(
// /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin;
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if false;
}
match /proposal-attachments/{proposalId}/{document=**} {
allow read: if true;
allow write: if request.auth != null && (
request.resource.contentType.matches('application/pdf') ||
request.resource.contentType.matches('image/.*') ||
request.resource.contentType.matches('text/plain') ||
// Word documents
request.resource.contentType.matches('application/msword') ||
request.resource.contentType.matches('application/vnd.openxmlformats-officedocument.wordprocessingml.document') ||
// Excel spreadsheets
request.resource.contentType.matches('application/vnd.ms-excel') ||
request.resource.contentType.matches('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') ||
// PowerPoint presentations
request.resource.contentType.matches('application/vnd.ms-powerpoint') ||
request.resource.contentType.matches('application/vnd.openxmlformats-officedocument.presentationml.presentation')
) &&
request.resource.size < 10 * 1024 * 1024;
}
}
}