Back

[SOLVED] Difference Role guest vs. any?

  • 0
  • Accounts
whataboutno13
29 Mar, 2023, 13:05

Hi there <:appwritefire:823999000330895380> , I can not wrap my head around the permission differences of Roles guest and any. What exactly is the difference? How does appwrite determine of one is a guest and not anyone? Are there any docs i have missed?

TL;DR
The user is confused about the difference between the 'guest' and 'any' roles in Appwrite. The support team explains that the 'any' role includes all users with active sessions, including guests, while the 'guest' role only includes guests and not logged-in users. They provide a link to the documentation for more information on permission roles. The issue is marked as solved. Solution: The 'any' role includes all users with active sessions, while the 'guest' role only includes guests and not logged-in users. More information can be found in the documentation.
Binyamin
29 Mar, 2023, 13:23

The different is if a collection for example has a permission of any then anyone can access it But if it has the guest permission then only guests can see it and not anyone else So the wrap it

  • Any - anyone, guests, logged in and members of them
  • Guest - Guests only logged in user won't have access

You can read more about it here https://appwrite.io/docs/permissions#permission-roles

whataboutno13
29 Mar, 2023, 13:26

Thank you for your answer! πŸ™‚ I still dont quite get it. What exactly differs a user from anyone? How does appwrite determine if one is a guest of my website/app/whatever and not just some rando sending requests to my server?

Binyamin
29 Mar, 2023, 13:28

Ohh Like that A user is anyone that have an active session against your Appwrite endpoint That mean the this user has to be logged in to your endpoint using any one of the methods

  • Email
  • OAuth2
  • Magic URL
  • Phone
  • Anonymous Or is request came with a valid JWT

Otherwise this user will be treated as a guest

Any - is in both cases

Binyamin
29 Mar, 2023, 13:30

P.s. you don't need to worry about the session logic or arranging the user ID in your functions or database fetch, as Appwrite is taking care of those parts for you

whataboutno13
29 Mar, 2023, 13:30

Ah okay, so any just includes both users with active sessions and guests πŸ‘

Binyamin
29 Mar, 2023, 13:31

Exactly

whataboutno13
29 Mar, 2023, 13:31

Perfect, thanks!

Binyamin
29 Mar, 2023, 13:31

πŸ˜„

whataboutno13
29 Mar, 2023, 13:32

[SOLVED] Difference Role guest vs. any?

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