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
- [ENHANCEMENT] Use the custom Next.js dep...
Deployment adapters on Next.js are now stable! This means that we don't have to stick to the limitations of sniffing out build outputs and manually moving or mo...
- NextJS builds sudden runtime_timeout
My builds suddenly stopped working. Activating old prebuilt snapshots work, but redeploying that same code produces builds that throw runtime_timeout FRA region
- Project paused?
Hello, I have two Appwrite projects and I can not resume them for some reason. I'm using the free plan, and I saw in the pricing page that 2 free projects are a...