-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathstorage.rules
More file actions
27 lines (22 loc) · 864 Bytes
/
storage.rules
File metadata and controls
27 lines (22 loc) · 864 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
// NOTE: Storage rules are NOT auto-deployed by CI.
// After editing, deploy manually: firebase deploy --only storage
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Per-user resumes folder
match /resumes/{userId}/{fileName} {
// Allow the owner to read their own files
allow read: if request.auth != null && request.auth.uid == userId;
// Allow the owner to upload/replace files only if it's a PDF
allow write: if request.auth != null
&& request.auth.uid == userId
&& request.resource.contentType == 'application/pdf';
// Allow the owner to delete their own files
allow delete: if request.auth != null && request.auth.uid == userId;
}
// Deny everything else
match /{allPaths=**} {
allow read, write, delete: if false;
}
}
}