Back

[SOLVED] About function execution permissions

  • 0
  • Self Hosted
  • Functions
  • Tools
Abdulramon Jemil
30 Jun, 2023, 15:03

From what I can see, is it possible to set the $permissions manually when creating execution using serverside apis?

TL;DR
User has questions about function execution permissions in the appwrite/appwrite model. They ask if meta fields like `$permission` are returned when using `Query.select()`, and if it's possible to set `$permissions` manually when creating execution using serverside APIs. Another user explains that it's not a bug, but actually a feature to protect execution data. They recommend tunneling the information through a function if needed. They also suggest using the `getExecution` function to check if a function has finished executing. There is a question about setting execute access to `users` and not being able to execute the function on the client, but it
Abdulramon Jemil
30 Jun, 2023, 15:03

It's not possible from what I can see

Binyamin
30 Jun, 2023, 15:04

It looks like you can't

Abdulramon Jemil
30 Jun, 2023, 15:05

What would be the value of the $permissions if I create the execution from the server?

Abdulramon Jemil
30 Jun, 2023, 15:05

An empty array?

Binyamin
30 Jun, 2023, 15:05

Yep

Abdulramon Jemil
30 Jun, 2023, 15:06

Did you already check it out before?

By the way, which panel is shown in this image? Is it something viewable on appwrite cloud? I mean the panel as you've shown it

Binyamin
30 Jun, 2023, 15:07

Yes, I've checked

Binyamin
30 Jun, 2023, 15:07

This PHPStorm uses the DataGrip software to view my self-hosted Appwrite instance.

Abdulramon Jemil
30 Jun, 2023, 15:08

Any way, thanks for helping

Binyamin
30 Jun, 2023, 15:08

<a:agooglethumbsup:635256484682530825>

Abdulramon Jemil
30 Jun, 2023, 15:11

One last thing, what is the purpose of the async option when creating function execution? If it is set to false, does it mean that I can directly await the execution in my code and access the final response directly?

Binyamin
30 Jun, 2023, 15:12

Yes, exactly.

Binyamin
30 Jun, 2023, 15:12

For example

Binyamin
30 Jun, 2023, 15:12

Let's say you have a function that need to get something protect from the DB Then you'll probably want the function to be executed in sync mode.

Binyamin
30 Jun, 2023, 15:13

But if you have a function that can take time Then you'll execute it in async. Then you can use the getExecution to see if it finished.

Abdulramon Jemil
30 Jun, 2023, 15:14

Yeah, I get that

Thanks once again

I also saw something in the thread you linked about the person setting execute access to users and still not able to execute the function on the client saying that only guests and any are allowed, is that some bug, or did I get it wrong?

Binyamin
30 Jun, 2023, 15:16

It's not a bug more like a feature 😉

What I mean is that it's a bug if you want to be able to get the execution status for guests. But, is actually a feature meant to protect the execution data.

So, in case you'll need to have that information for guests, you can tunnel it thorugh a function.

Abdulramon Jemil
30 Jun, 2023, 15:17

Okay then, thanks

Abdulramon Jemil
30 Jun, 2023, 15:17

[SOLVED] About function execution permissions

Abdulramon Jemil
30 Jun, 2023, 15:57

One quick question, whe using Query.select(), are meta fields like $permission still returned even if they've not been included in the list of fields to be selected?

Abdulramon Jemil
30 Jun, 2023, 16:02

Okay, thanks

Drake
30 Jun, 2023, 16:54

Looks like thats a bug in the model example...would you be able to create an issue for that?

Abdulramon Jemil
30 Jun, 2023, 16:58

I'm kinda busy at the moment, but will see to it later, hopefully.

I'll file the issue on appwrite/appwrite, right?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more