I want to create user based security for Firebase/Storage. Below allow write works well if I do only upload images. But It prevents deleting a photo. How can I create proper sec
I would use this to check if you are creating/updating a file or removing it
match /users/{uid}/{filename} { allow write: if isCurrentUser(uid); allow write: if resource == null || ( isImage() && lessThanNMegabytes(n) && request.resource !=null && filename.size() < 50 ); }