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
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...