Reputation: 1742
Is there a method/ruleset for Firebase 3 storage to disable file updating or overwriting?
I found data.exists() for Database but no solution for Storage.
Upvotes: 6
Views: 2430
Reputation: 15963
TL;DR: In Storage Security Rules, request.resource
~= newData.val()
and resource
~= data.val()
, so you can use them similarly.
service firebase.storage {
match /b/<bucket>/o {
match /path/to/file {
allow write: if resource == null; // if !data.exists() in DB land
}
}
}
Upvotes: 14