Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

firebase

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?

like image 634
Abe Avatar asked Apr 11 '14 15:04

Abe


1 Answers

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()"
like image 189
Kato Avatar answered Sep 29 '22 12:09

Kato