In firebase, can I set permissions to allow only PUSH operations to a given object?

StackOverflow https://stackoverflow.com//questions/23017256

  •  21-12-2019
  •  | 
  •  

Question

The title says it all. I want to grant permissions to push new objects to a given list-style database, but I don't want to allow full write permissions. In this possible?

Was it helpful?

Solution

Not sure what "not allow full write permissions" means or that the title does indeed say it all. But let's assume this means you want to be able to add records but not delete or modify them? Making these assumptions, you could simply do a write rule as follows:

// !data.exists(): only push once, no edits
// newData.exists(): cannot delete
".write": "!data.exists()"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top