So, I have comments and items. When a comment is added to an item, we update the parent item's updatedDate. I have a .write rule on the item that checks the auth.user against the child("user"), but then a specific rule on updatedDate that lets any authed user update it, so that this works fine. Problem is I also then update the priority, and I get permission denied because AFAIK there's no way to specifically allow setting priorities while keeping the whole of the item under lock with the .write rule.
It seems like a pretty straightforward use case: update the priority (order) of an item once it has some new activity.
I know the newer Firebase stuff introduced indexes and orderBy – I use this on the server side with the REST API, but not client because the library I use (firebase.dart) only recently got some love there and I have to approach it carefully. With indexes, I could in theory just store a updatedDate.millisecondsSinceEpoch and let that be my priority/orderBy. I could move my addComment() to the server to take advantage of that stuff, but I'm checking in to see if I really have to.
Thank you!