Rank 1: Thread
Hi guys, I want to restrict the execution access to a function I have created to a team and to a user. I have read other posts on this suggesting that setting the async flag to false may help but it didn't in my case:
session.then(function (response) { console.log(response); // Success const functions = new Functions(client); const promise = functions.createExecution('64e459b015c232d2e51d',undefined, false); promise.then(function (response) { console.log(response); // Success }, function (error) { console.log(error); // Failure }); }, function (error) { console.log(error); // Failure });Based on the errors, it seems like Appwrite only accepts "any" and "guests" for Execute Access:
AppwriteException: Missing "execute" permission for role "user:007". Only "["any","guests"]" scopes are allowed and "["users","user:007"]" was given.
at Client.<anonymous> (file:///D:/repo/test_appwrite/node_modules/appwrite/dist/esm/sdk.js:391:27)
at Generator.next (<anonymous>)
at fulfilled (file:///D:/repo/test_appwrite/node_modules/appwrite/dist/esm/sdk.js:22:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 401,
type: 'user_unauthorized',
response: {
message: 'Missing "execute" permission for role "user:007". Only "["any","guests"]" scopes are allowed and "["users","user:007"]" was given.',
code: 401,
type: 'user_unauthorized',
version: '1.3.7'
}
}
Anything else I can try?