rules_version = '2'; service firebase.storage { match /b/{bucket}/o { 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 in ['image/jpeg', 'image/png', 'image/webp']; } match /cropTroubleReports/{reportId}/shared-photo { allow read: if request.auth != null; allow write: if request.auth != null && request.resource.size < 5 * 1024 * 1024 && request.resource.contentType in ['image/jpeg', 'image/png', 'image/webp'] && request.resource.metadata.ownerId == request.auth.uid && request.resource.metadata.reportId == reportId; } match /{allPaths=**} { allow read, write: if false; } } }