i have the following function when i added permissions it started to give an error
try {
const client = this.initAppwriteClient();
const teams = new appwriteSdk.Teams(client);
console.log('============================', id, owner);
const permissions = [
appwriteSdk.Permission.read(appwriteSdk.Role.team(id)),
appwriteSdk.Permission.read(appwriteSdk.Role.user(owner)),
appwriteSdk.Permission.write(appwriteSdk.Role.user(owner)),
appwriteSdk.Permission.update(appwriteSdk.Role.user(owner)),
];
await teams.create(id, name, permissions);
} catch (error) {
console.log('error ======>>>>>>', error);
throw new BadRequestException('create new team error', error);
}
}
i am getting this error :
code: 400,
type: 'general_argument_invalid',
response: {
message: "Invalid roles param: Value must a valid array and Parameter must contain at most 36 chars. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char",
code: 400,
type: 'general_argument_invalid',
version: '1.4.2'
}
although i don't have any special char in the id and it match all Valid chars
Uh try removing the permission stuff
but how can i add permissions, i tried adding it on the createMembership, still got the same error
you don't permissions are applied on the resource (collection, document, bucket, file, etc)
Recommended threads
- Invalid query: Query on attribute has gr...
I cannot view the table within the Console
- 1:1 relationship doesn’t sync after re-a...
Hi, I’m trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...
- Upsert with setting permissions
Hi there, I am using self-hosted appwrite v1.7.4 and trying to use the bulk update stuff that was released with 1.7.x. Unfortunally I found that there is an ser...