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!
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
And you can join a team yoursefl with functions
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
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
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
.
I mean you use functions to assign permission, so you still use appwrite permission system
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
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?
Thank you for your help so far!
Recommended threads
- The current user is not authorized to pe...
I want to create a document associated with user after log in with OAuth. The user were logged in, but Appwrite said user is unauthorized. User is logged in wi...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...
- I recently applied for the free plan und...
I recently applied for the free plan under the GitHub Student Developer Pack. However, my billing status still shows $15, and it mentions that this amount will ...