Can I check whether the user sending the request is premium in appwrite functions, create a team within the function, and assign the user sending the request as the team owner?
TL;DR
1. You can retrieve the user ID from the `x-appwrite-user-id` header in the header.
2. Use the `listMemberships` function to check the user's membership status.
3. Utilize the Team Server SDK to add the user to the team as the owner.Sure
- Inside the header
x-appwrite-user-idyou'll have the user ID. - Then you can use the `listMemberships` to check the user membership status
- Then you can use the Team Server SDK to add the user to the team and give the user the
ownerrole
Thank you ๐
[SOLVED] Create team in fuction
Recommended threads
- Worker functions stuck on "Fetched 0 fun...
Appwrite Version: 1.9.0 Bug Description: The appwrite-worker-functions container gets stuck in an infinite loop logging "Fetched 0 functions..." while scheduled...
- I am using s3 for app storage but is it ...
_APP_STORAGE_DEVICE=s3 puts everything to the s3 storage but i need to be able to keep the function builds and site in the local and not waste the cloud storage...
- Local Serverless Function Testing: Are D...
I have followed the instructions to get the CLI working, and have been able to log-in, initialize my project, and created a simple Python function, which calls ...