I have a next js page that displays all of the items in a collection “orders” in firestore, in that page the user could delete orders if they would like.
I’m using nextauth for authentication so writing firestore rules for when a user will be able to delete a document might be challenging so instead of that I’m trying to make the database calls from the server but the problem is that my current solution requires fetching all the documents every single time the user deletes an order.
In that page you could assume the user has delete and list permissions because I’m handling that in the middleware.