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
- Migrate from cloud to localhost
Hello everyone. I need to migrate my test project from cloud to localhost, however it seems that this is possible only if a self-hosted appwrite instance it's h...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...