Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

making a folder public in Firebase Storage

i need to set a folder public with only read permisions in firebase storage, my security rules are

service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write:if request.auth.uid != null;
    }
    match /{platos=**} {
      allow read;
    }
  }
}

the folder is called platos and im not sure if those rules are secured the others folders must have protection only for logued users

like image 395
Alejandro Avatar asked Oct 16 '25 13:10

Alejandro


1 Answers

The first rule should concern your folder, because otherwise the first rule is applied which rejects reads:

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /platos/{allPaths=**} {
        allow read;
        allow write: if request.auth != null;
    }
    match /{allPaths=**} {
      allow read, write: if request.auth != null;
    }
  }
}
like image 91
Lukasz Frankowski Avatar answered Oct 18 '25 11:10

Lukasz Frankowski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!