"Invalid `roles` param: Value must a valid array no longer than 100 items and Parameter must contain
- 0
- Auth
- Web
- Cloud

I have this code
await teams.createMembership( 'admin', // The team ID [ Permission.update(Role.user(userRefId)), // Permissions for the user Permission.read(Role.user(userRefId)) ], this.accountForm.value['userName'], // User name userRefId // User ID );
Im usng ID.unique() to generate the values of IDs. I'm sure its in the roles array but I follow the documentation here (https://appwrite.io/docs/advanced/platform/permissions#example-1-basic-usage)
What could be the cause of the error?

The documentation you’ve pointed to is on how to use Permissions / Roles to control access to resources. teams.createMembership()
is to add a user to a Team, and set the user’s Roles.
You can see the documentation for teams.createMembership()
here

Directly addressing your error here, the roles
array (the second parameter in teams.createMembership()
should be an array of strings
Recommended threads
- Relationship Attribute Deletion Causes D...
I'm experiencing a critical bug with Appwrite CLI that causes complete data loss when making minor schema changes to relationship attributes. What I Tried To D...
- Help on importing data - error Unknown a...
Hey There! I want to create a local environment on my new computer, i wish to get the information i have on my staging appwrite cloud server. When running mig...
- login backend and frontend
I'm using Remix, as my Backend (node). and react on my frontend. Until now, i did SSR login. saved the secret.. and it's fine. For many simpler requests i wish...
