Back

Prevent other users in a team getting email

  • 0
  • Teams
  • Flutter
Binyamin
19 May, 2023, 18:55

But how bots will have access to your team? By signing?

TL;DR
The user wants to prevent other users in a team from getting email. One possible solution is to disable the teams service in the project settings. This will block the teams feature in the client SDK requests, but the logic behind it will still be accessible. Another suggested solution is to create a separate collection for each entity and use teams only for access control. The teams service was designed for the use case where someone invites others to view/update/delete resources, so it may not be necessary for this particular use case. Bots can have access to teams by signing in.
D5
19 May, 2023, 19:39

Yes, there will be public teams, so anyone can join. The architecture is like a discord clone

D5
19 May, 2023, 19:41

There are some public servers you can join, others are private, requiring an invitation. You can see users profile, but you can't see their emails

D5
19 May, 2023, 19:50

So my idea was making all public server like if it was a team, and the user joins the severe by join the team

Drake
19 May, 2023, 20:17

If I were you, I would:

  1. Create a collection for each entity like users, servers, posts, requests etc.
  2. Use teams only for access
  3. Disable the teams service to prevent end users from using the teams service.

I think the teams service was designed for the use case where someone who owns a resource wants to invite someone to view/update/delete it. Since your use case is kind of the opposite, there's no need to use the invite system

D5
19 May, 2023, 20:24

So then for example, If I have a post, should I create a database for users and the associate the post to the user?

D5
19 May, 2023, 20:26

And in the case of saved pages, having a separate database that associates both users and saved pages?

D5
19 May, 2023, 20:27

Definitely, yes, I think I'm using teams for a thing it's not designed to

Drake
19 May, 2023, 21:04

So multiple databases? Why exactly?

D5
19 May, 2023, 22:21

I mean collections πŸ˜…

Drake
19 May, 2023, 22:57

how so and why?

D5
19 May, 2023, 23:00

Discord example: User wants to join a server: Then in the "saved servers" collection, creating a new document with the user ID and the corresponding server

I'm not sure if there's a better approach

Drake
19 May, 2023, 23:30

so 1 collection per object type, right?

Binyamin
19 May, 2023, 23:31

All of the above πŸ˜‰

D5
20 May, 2023, 04:17

1 document per server saved that contains that:

  • ServerID/relationship
  • UserID

That way when the app is loaded, the users gets all documents containing it's userID, and then it search the servers containing such ID's

D5
25 May, 2023, 13:03

I have another problem with that, who is basically that data in the server will be publicly available, so how I could limit it to only allow read access to users that saved the server?

Binyamin
25 May, 2023, 13:31

You can create a team, and each server message will be tied to a Team. then set the permissions of the server message only to a Team memebers.

D5
25 May, 2023, 14:03

Emails will be revealed to every member

D5
25 May, 2023, 14:04

I would like to achieve exactly the same or something similar as teams but without revealing emails to everyone

Binyamin
25 May, 2023, 14:08

Ohh, right. You try what Steven suggested here. Work with Teams but disable them in the project settings

Binyamin
25 May, 2023, 14:08

I think doing so will block it from the Client sdk but not the logic behind it.

Binyamin
25 May, 2023, 14:15

If you look here https://github.com/appwrite/appwrite/blob/master/app/controllers/general.php#L352-L356

It's seems like when a service is disabled then it won't be available only to regular users, that means all the Teams Client SDK requests.

It looks like this would be a great solution for your use-case

D5
25 May, 2023, 15:01

Thanks, I will try that! Definitely that should be the best solution

D5
25 May, 2023, 15:02

I thought that disabling teams from console meant disabling it for everything, both client and server side

Binyamin
25 May, 2023, 15:03

That was my thought too

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