-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
25 lines (22 loc) · 890 Bytes
/
storage.rules
File metadata and controls
25 lines (22 loc) · 890 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
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Project canvas PNG blobs: projects/{userId}/{contentHash}.png
match /projects/{userId}/{fileName} {
// Anyone authenticated can read (for public projects, download URL is shared)
allow read: if request.auth != null;
// Only the owner can create or overwrite, PNG only, max 10 MB
allow create, update: if request.auth != null
&& request.auth.uid == userId
&& request.resource.contentType == 'image/png'
&& request.resource.size < 10 * 1024 * 1024;
// Only the owner can delete
allow delete: if request.auth != null
&& request.auth.uid == userId;
}
// Deny all other paths by default
match /{allPaths=**} {
allow read, write: if false;
}
}
}