Back

[SOLVED] Set function permissions before deploying

  • 0
  • Functions
KingBob
2 Dec, 2023, 20:52

Hi there. Is there a way to set the function permission within the function itself or in the JSON file?

The problem: I am having to set permissions for the function in the console every time I redeploy the function via the CLI " appwrite deploy function" command. Is there a way to set it before deploying it via CLI?

Thanks in advance

TL;DR
The user was originally having trouble setting function permissions before deploying, but they were able to solve it. The solution was to set the execute attribute in the function section of the appwrite.json file to the desired permissions, such as "execute": ["users"]. They also provided an example of how to set the permissions in the appwrite.json file.
Meldiron
2 Dec, 2023, 20:53

Hi 👋 In appwrite.json, there is functions key and in your function definiton there you can find execute array of permissions. Once set there, those will be applied on every redeploy

Meldiron
2 Dec, 2023, 20:53

Here is an example: https://github.com/Meldiron/almost-wishlist/blob/main/appwrite.json#L71

Possible value is for example any, users, guests, ..

KingBob
2 Dec, 2023, 20:54

Thank you. I will definately check this out.

KingBob
2 Dec, 2023, 21:09

@Meldiron Thank you. I got it. I just had to set the execute attribute in the function section of my appwrite.json to this "execute": ["users"]

Meldiron
2 Dec, 2023, 21:09

Great job ✨

KingBob
2 Dec, 2023, 21:09

[SOLVED] Set function permissions before deploying

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