In my application, I logged in as a member with the role of "admin" of a team (invited using an "owner" of the team). When trying to call teams.createMembership to create another member, i.e. of role "staff" it's throwing the error "User is not allowed to send invitations for this team".
Looking at the code at https://github.com/appwrite/appwrite/blob/1.1.x/app/controllers/api/teams.php#L320 and https://github.com/appwrite/appwrite/blob/1.1.x/src/Appwrite/Auth/Auth.php#L383, shouldn't the "admin" member considered as a privileged user?
Can a non-owner of a team invite other members?
The isPrivilegedUser function isn't relate to the end-user teams, but the current execution level.
The admin in this function is it for the internal project team.
The part that check if the current user is owner is here: https://github.com/appwrite/appwrite/blob/1.1.x/app/controllers/api/teams.php#L384
This mean that any permission except owner will be treated the same.
I see
So.. in our applications, if we need to allow an app admin to invite members, it must be done with a function?
You can give them the owner role
You can have more then one owner
hmmm ok, I think that works, but that also means these app admins can delete the team
Yep.
The only other way would be through teams.
If you think that the need to have moderators-level in team, then, I suggest to create an issue for that feature request
Alright, I'll first see what kind of workaround is possible. Otherwise will create a feature request
Thanks for your help!
<a:agooglethumbsup:635256484682530825>
For future reference: I think the "User labels" Eldad mentioned in https://github.com/appwrite/appwrite/issues/4834#issuecomment-1574944467 may fit the use case
I think this is roles, but, without teams
hmm ok, yeah that makes sense
Recommended threads
- TLS provisioning failure for custom doma...
Hi Appwrite team, we’re using Appwrite Sites and TLS provisioning for our custom domain fails. Domain: somnara.app Error: Failed to create TLS subscription –...
- Functions Problem
Whenever I run my AI Generate through Appwrite Functions, I am getting this Call Stack AIService.generateServer (src\services\ai\gemini.ts) next (<native>) ...
- Frequent 500 Internal Server Errors - Pr...
PROJECT ID: 6951f2xxxxx1ee9e750a REGION: Singapore (sgp.cloud.appwrite.io) PLAN: Pro Our production application experiences **500 Internal Server Errors** mult...