Back

Team scoped user permissions without Invites

  • 0
  • Teams
  • Flutter
  • General
  • Accounts
Kryper
24 May, 2023, 08:00

Hello everyone! First of all, thank you for the continuous development and community effort! It is a joy to work with Appwrite and its SDK.

We are using Appwrite as a backend for our Flutter application and are facing some design decisions. Our App shall group users / devices and allow them access to documents that are scoped to this groups. Similar to Discord, users shall be able to join this group without having to leave the app. For this we are thinking of scanning a QR code on devices that are already part of the group or simply sharing a link that contains the group id.

My question now is how we would setup Appwrite to provide correct scoping and permissions. I thought of creating a team per group and then set the permissions of each document scoped to the group with permissions restricted to the team. However, as far as I understand it is not possible to join a group directly as a user without an invitation of the owner, is this correct? Additionally, users might be "Anonymous" and cannot receive any Invite material via Email/Phone etc. Can this be achieved via Functions? I understand that it might seem ridiculous to scope the permission to a team when everyone can join, but we believe this way we can easily change the membership mechanism without affecting existing permissions and document access.

Please let me know if more information is required! We are happy of any suggestion and ideas to solve this design problems 🙂 BR and thanks in advance!

TL;DR
The user wants to implement team-scoped user permissions in their Appwrite backend for their Flutter application, similar to Discord. They are considering creating a team per group and setting permissions for each document scoped to the group. However, they are unsure if it is possible to join a group directly as a user without an invitation. They also mention the possibility of using functions. One suggestion is to create public groups by using a function that adds the user to a team without an email invitation. Another suggestion is to create a database with user IDs and Discord server IDs for public groups, and create groups for private channels. The user is looking for suggestions and
D5
24 May, 2023, 08:48

I'm making something similar. If groups are public, you can achieve that by creating a database with users ID and discord server ID, that way when user joins, you create a new entry with current user ID and server ID

For private channels, you can create groups

In order to achieve that, you can create cloud functions

D5
24 May, 2023, 08:49

And you can join a team yoursefl with functions

D5
24 May, 2023, 08:50

But it's not very recommended to allow everyone joining teams, since that could make emails being publicly available, so in my opinion, for public teams it's better the first approach

D5
24 May, 2023, 08:52

If you don't want users having permissions to see emails in private channels, you could assign permissions individually instead of grouping them in teams, however, I'm not sure if that's very efficient from performance side

Kryper
24 May, 2023, 09:39

Hmm I see. I am not keen on implementing to many custom permissions behind Functions, as this would probably defeat the purpose of Appwrites permission system.

Your first idea of public groups is what we are essentially doing right now, but this also means that all our documents for the server will have to have a permission set to any.

D5
24 May, 2023, 10:16

I mean you use functions to assign permission, so you still use appwrite permission system

D5
24 May, 2023, 10:17

So with the function, what you make is checking if the code is correct or not and the creating the corresponding field and assign permissions

Kryper
24 May, 2023, 13:57

Hmm I am not sure if i understand correctly. Correct me if i am wrong, what you are proposing that a user joins a team by calling a function right? Say we have a function that receives a team id… this way it can add my user to a team without an email invitation or any confirmation outside of my app.. is this correct?

Kryper
24 May, 2023, 13:57

Thank you for your help so far!

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