0

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!

  • 1
    Hi Your question needs some clarification. Do you want to use db or firestore ? Please be more clear. I assume you want whatever storage you want to use in firebase to be protected by any anonymous modification. 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: https://firebase.google.com/docs/functions – hatirlatici Feb 06 '21 at 23:32
  • I'm using firestore, this seems like a what I need. Thanks!!! – CodingEquals MyLife Feb 07 '21 at 22:23
  • @hatirlatici, how can I mark that your answer solved the question? – CodingEquals MyLife Feb 07 '21 at 22:26
  • I think you need to upvode my comment. – hatirlatici Feb 08 '21 at 06:55

1 Answers1

0

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 –

marian.vladoi
  • 7,663
  • 1
  • 15
  • 29