"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
- Weird permission failure
when creating an account I use following methods: ``` Future<void> register(String email, String password, String username) async { final user = await accoun...
- Appwrite Storage error 503s for automate...
I'm facing error 503s from Appwrite after about 5-6 seconds of making AI requests from my tool with images and files above 20MB (=> not inline base64 used, but ...
- Flutter Android oAuth is no more working
I currently don't get the oAuth login to work in flutter android. it works on ios and on web. but when try to use it on Android, i get to the point where the ca...