-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
25 lines (23 loc) · 891 Bytes
/
storage.rules
File metadata and controls
25 lines (23 loc) · 891 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 {
// Allow users to upload images to temp folder
match /temp/{allPaths=**} {
allow read: if true;
allow write: if request.resource.size < 10 * 1024 * 1024 // 10MB limit
&& request.resource.contentType.matches('image/.*');
}
// Processed images - read only for users
match /processed/{allPaths=**} {
allow read: if true;
allow write: if false; // Only functions can write
}
// Future: user-specific storage
match /users/{userId}/{allPaths=**} {
allow read: if request.auth != null && request.auth.uid == userId;
allow write: if request.auth != null && request.auth.uid == userId
&& request.resource.size < 10 * 1024 * 1024
&& request.resource.contentType.matches('image/.*');
}
}
}