Last active
February 22, 2025 18:27
-
-
Save RobSpectre/6a1115ca923357697a172b5e2d29ceda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rules_version = '2'; | |
service firebase.storage { | |
match /b/{bucket}/o { | |
function isSignedIn() { | |
return request.auth != null; | |
} | |
function isUser(userId) { | |
return request.auth.uid == userId; | |
} | |
// Allow initial file upload | |
match /uploads/{processId}/{userId}/{dateString}/{allPaths=**} { | |
allow write: if | |
isSignedIn() && | |
request.resource.size <= 7 * 1024 * 1024; // 7MB limit | |
allow read: if false; | |
} | |
// Allow access to generated files | |
match /generated/{processId}/{userId}/{allPaths=**} { | |
allow read: if | |
isSignedIn() && | |
isUser(resource.metadata.userId); | |
allow write: if false; | |
} | |
// Default deny | |
match /{allPaths=**} { | |
allow read, write: if false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment