0

Firebase Storage Security Rules Problelm

I made a web app in which users images store in firebase storage with folder of their user authentication id. I want to set security rules for all of these folder created with user id. There is also other folder in which web app home image saved. I try many times to setup security rules but there is problem every time in deleting and getting images rules_version = '2'; service firebase.storage { match /b/{bucket}/o { match /{userId} { allow read; allow update,delete:if request.auth.uid == userId; allow create: if request.auth != null; } } }

25th Feb 2021, 3:29 PM
Saad Saleem
Saad Saleem - avatar
1 Answer
+ 1
the syntax looks abit problematic try the following syntax. service firebase.storage { match /b/{bucket}/o { match /user/ { match /thumbnails/{userId}/{thumbnail} { allow read: if request.auth.uid == userId; } match /uploads/{userId}/{upload} { allow write: if request.auth.uid == userId; } } } }
28th Feb 2021, 7:24 PM
N A I E B I