-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorage.rules
More file actions
24 lines (21 loc) · 839 Bytes
/
Copy pathstorage.rules
File metadata and controls
24 lines (21 loc) · 839 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
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
// Scans folder - users can only access their own images
match /scans/{userId}/{allPaths=**} {
// Allow read if user is authenticated and accessing their own folder
allow read: if request.auth != null && request.auth.uid == userId;
// Allow write if user is authenticated and uploading to their own folder
allow write: if request.auth != null
&& request.auth.uid == userId
&& request.resource.size < 10 * 1024 * 1024 // 10MB limit
&& request.resource.contentType.matches('image/.*');
// Deny all other operations
allow delete: if false;
}
// Deny all other access
match /{allPaths=**} {
allow read, write: if false;
}
}
}