async function createUserDB(
id: UserId,
values: CreateUserParams
): Promise<User> {
const { databases } = await createAdminClient();
const document = await databases.createDocument<User>(
envi.NEXT_PUBLIC_DATABASE_ID,
envi.NEXT_PUBLIC_USERS_COLLECTION_ID,
id,
values,
[
Permission.read(Role.any()),
Permission.update(Role.user(id)),
Permission.delete(Role.user(id)),
]
);
return document;
}
i added read, update and delete permissions, can u explain what create Permission means here?
yep In first here anyone can read your database of Your project on the other hand last two permissions are users can update & delete
what about create Permission.create()
if i add here [Permission.create(Role.user(id)),
what will be goal of that?
Recommended threads
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...