MishoOriginal post
Rank 2: Process
JavaScript
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?
Summary
The developer is confused about the `Permission.create()` function in their code. They are unsure of its purpose in relation to reading, updating, and deleting permissions. The `Permission.create()` function is not a valid permission type. The solution for the developer is to remove `Permission.create()` and only utilize `Permission.read()`, `Permission.update()`, and `Permission.delete()` for the specific permissions needed in the code.