firebasefirebase-realtime-databasegoogle-cloud-firestorefirebase-securitydatabase-security

Is there a way to update a firestore's document without giving permissions to the the user?


Let me explain my issue better, the question phrasing was a little bit confusing. I want a global "clicks" document to update each time that a user clicks in an HTML element in my webpage. This is easy enough to do with the standard functions and by giving the user permission to update the content in the "clicks" document. The problem is that I don't want the user to have the full authority to change the document's properties freely. I just want to receive the click and update the database. The reason is that if the user can do whatever he wants with the clicks property then it will not be indicative of anything.

Any help is received, thank you in advance!


Solution

  • So you could use an http cloud function, in that case you do not need to give the direct access, instead you could trigger a cloud function and cloud function would go to that db/storage to do what ever update you want in your db/storage. Please check this out: firebase.google.com/docs/functions –