Back

collection specific permissions for dynamic key

  • 0
  • Functions
  • Cloud
d_honig
15 Oct, 2024, 14:07

Is it possible to give a dynamic key permission to delete a specific collection or database instead of all of them? There is one database that we want to put extra protections on to prevent accidental deletion. Our cloud function has permission to delete documents. Is there a way to specify that a particular collection cannot be deleted using the dynamic key of the cloud function? Is there a way to specify this using regular keys? I understand that the permissions in the collection settings are not used if using a key, is this correct? Thank you

TL;DR
Developers asked if it's possible to give a dynamic key permission to delete a specific collection or database instead of all of them. They want extra protections on a database to prevent accidental deletion with the cloud function's key. The solution is to set up authorization within the function to prevent access to certain collections. Collection settings permissions are not applicable when using a key.
Kenny
15 Oct, 2024, 14:15

I don't believe there is a way to limit api keys to just specific collections. They operate as an admin of sorts, you grant them access to everything. Collection.Read, grants them access to read everything within all collections. You can setup your own authorization within the function, preventing it from accessing certain collections.

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more