You mean the teams feature?
I think that the best way is using the teams feature to manage permissions and the database for everything else
But my permissions are "you can only read and write stuff associated with your team"
Which I don't think is odd per-se, right?
Or am I placing semantics on Team which don't apply to it?
I'd still need a way to associate identity to a resource though, like which users are in the codename "Organization", which is a collection I have in my database
Ok I've take a look at what Teams can do, I am abusing its semantics. So the question is now, how do I associate Users to documents?
Teams allow you to group permissions so you give them to the entire team instead of a particular or some specific users.
When you create, you set an array with the permissions: https://appwrite.io/docs/advanced/platform/permissions
Forget permissions for now, lets say there are no premissions in my application
it's unrelated to my question in actuality
Well, if there are no permissions, no one will be able to access the docs.
Unless you grant permissions for everyone
then permissions are fully lax, everyone can do anything including guests
like I said, it's a totally unrelated conversation
Okay, so I think I didn't understand it well 😅
I want the moral equivalent of doing GET /things?organization=123, and more importantly I want the moral equivalent of GET /organizations?userId=123
not literal equivalent, I'll be using the SDK, I need to have some sort of abstraction that allows me to group users into organizations
So basically you mean grouping documents?
yes
I think best way could be having a collection with all the organisations and then in the grouped docs setting a foreign key (a string) with the document ID that contains the org ID
An alternative are relationships, but you will not be able to query properly, so that's why I suggest using foreign keys for now
in a not-appwrite app I'd have Organization, Member and User. Organization has many Members and a User can have many Memberships. But in this case I can't associate the User with a Membership
so just using a String attribute and wingging it?
could you elaborate on this? Relationships are not the blessed way to represent relationships?
Recommended threads
- RowList: The value of total is coming as...
RowList: The value of total is coming as a String, so it throws an error because it’s not parsed into an int. Error: TypeError: \"37\": type 'String' is not a ...
- 408 Timeout / Curl Error 7 in Executor w...
Hey everyone, I am losing my mind over a routing loop/timeout issue on a fresh self-hosted setup. I have a single Linux VPS (IP: 45.141.37.105) and one domain (...
- functions returning error 401 in local
I updated to 1.9.0, and the functions that used to work fine in 1.8.1 are now giving me a 401 error. I can't seem to find a solution. If anyone is running versi...