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
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
Here is an example: https://github.com/Meldiron/almost-wishlist/blob/main/appwrite.json#L71
Possible value is for example any, users, guests, ..
Thank you. I will definately check this out.
@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"]
Great job ✨
[SOLVED] Set function permissions before deploying
Recommended threads
- How Can I Create landing page in appwrit...
I created function called invoice URL https://app.getrestt.com/v1/functions/invoice/executions?id=test-76f948fe83c43422561fe096c0674a1bd3ff0702cdfcf2444293ab31...
- DeploymentStatus enum value `canceled` m...
Hey, Sorry if it has been reported already, I found an issue using the Dart SDK where the `canceled` enum value is missing from `DeploymentStatus`. This causes...
- Synchronous function execution timeout w...
I am calling server functions with xasync = true and I still get this error message. Synchronous function execution timed out. Use asynchronous execution inste...