Skip to content

Commit

Permalink
fix: storage rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lemueldls committed Nov 5, 2023
1 parent d429560 commit 2919628
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions firebase/storage.rules
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,21 @@ service firebase.storage {
match /{allPaths=**} {
allow read, write: if false;
}

match /textbooks/global/{allPaths=**} {
allow read: if true;
}

match /textbooks/users/{uid} {
match /{allPaths=**} {
allow read, write: if request.auth != null && request.auth.uid == uid;
}

match /{hash}/doc.pdf {
allow create: if request.auth != null
&& request.resource.size < 5 * 1024 * 1024 // 5MB
&& request.resource.contentType.matches('application/pdf');
}
}
}
}

0 comments on commit 2919628

Please sign in to comment.