so im merging the data via a function
Okay, I meant what function you run to execute your function?
aaah ok
the first part goes well if i add any and guest to the permissions scope, the issue is on the getExecution
Looking into it
thanks
🤔🤔 It's interesting and we need confirmation for that from an Appwrite core <:appwrite:637383039499894787> member. When you give a Role access to execute function, it's only for execute it.
Then the other two client-side functions listExecutions and getExecution are available only to the user who created the function.
And guest can't be identified so he can never get the status of an executions.
ooh i see, and since im creating the function from the console, not the current logged in user on the dashboard that i have, so it never get the other 2 client side function permissions
If it is true, then To solve it you can change your function execution code to sync.
Exactly, It seems like that.
let me try with the async
it worked like this, which is weird, since the las argument was supposed to turn async on or off,
You can see that in the database if guest runs the function then no-one ger permission to read it
Actually it's good
Because when you passed the argument false (which is the default behavior) then you'll get back the execution status in sync
It would be nice if they would add an option for anonymous users, so you be able to run function in async.
yes, din't know the thing that user that create the function should execute it, it can run with guess, but so far i can run it with guest
so for now il use it like this, thanks for the big help
what do you mean?
Hi guys, I have set the async flag to false like:
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
});
But I'm still getting errors:
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?
Did you read this thread?
Also, did you have tried this?
If that doesn't solves your issue, please, create another post
Also, it's best to create a new post rather than posting in an old thread
Recommended threads
- Timed out waiting for runtime error
execution id 6a3e0791978712d81ee0 im having issue with appwrite function runtime performance. even after 4gbram and cpu same function sometimes completes in a...
- Project auto-blocked after load testing ...
Hi team 👋 My project has been automatically blocked with the message: "Project is currently blocked — Access to this project is restricted. Contact support if...
- App build crashing with "Internal error"
Hello Appwrite team! 👋 We are trying to deploy a Next.js application on Appwrite Cloud, but our builds are consistently failing. The deployment log successful...