#Missing "execute" permission for role "users".

33 messages · Page 1 of 1 (latest)

kindred glacier
#

hi there, im trying to run a function which i give user permission, but it's giving me this issue: Missing "execute" permission for role "users". Only "["any","guests"]" scopes are allowed and "["users"]" was given.',

cyan glade
#

It's weird as any and guests are not even in the execute access list.

kindred glacier
#

i know its weird, i updated from the 1.2x to 1.3x but i have other instance running on 1.3 from scratch with same issue

cyan glade
#

The only idea come to mind is double check all parameters and maybe try to remove to rule, save, then readd it.

kindred glacier
#

you say guest and any are not in the execute list, but i can see them on my instance, which is weird

cyan glade
#

I meant they not in the Added list

kindred glacier
#

if i add any and guest, i got this other error lool

cyan glade
#

What function do you run?

kindred glacier
#

im running a nodejs function that merge 2 collections data, since relationship still don't response anything

#

so im merging the data via a function

cyan glade
#

Okay, I meant what function you run to execute your function?

kindred glacier
#

aaah ok

#

the first part goes well if i add any and guest to the permissions scope, the issue is on the getExecution

cyan glade
#

Looking into it

kindred glacier
#

thanks

cyan glade
#

🤔🤔
It's interesting and we need confirmation for that from an Appwrite core appwrite 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.

kindred glacier
#

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

cyan glade
#

If it is true, then
To solve it you can change your function execution code to sync.

kindred glacier
#

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,

cyan glade
#

You can see that in the database if guest runs the function then no-one ger permission to read it

cyan glade
cyan glade
kindred glacier
#

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

naive valley
#

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?

halcyon breach
halcyon breach
#

If that doesn't solves your issue, please, create another post