is it possible to make a document with permissions from Appwrite functions
- 0
- Databases
- Functions
- Flutter

databaseId: databaseId,
collectionId: collectionId,
documentId: userId,
data: {
'userId': userId,
'email': userEmail,
'createdAt': DateTime.now().toIso8601String(),
'lastLogin': DateTime.now().toIso8601String(),
'isActive': true,
},
permissions: [
Permission.read(
Role.user(userId)), // Only the user can read their document
Permission.update(
Role.user(userId)), // Only the user can update their document
Permission.delete(
Role.user(userId)), // Only the user can delete their document
],
);
when i add the permissions in the functions i get an error AppwriteException: user_unauthorized, Permissions must be one of: (any, guests) (401
but when i remove it works fine ,i have selected all 10 of the Scopes for database.

How are you setting up your appwrite client?
Recommended threads
- Queries Length Error.
Hi All, I am having a issues across my app with how i am getting data, and just wanted to check if this was an issues with the new changes on appwrite over the...
- The current user is not authorized to pe...
I'm just getting this error while it was working couple minutes ago, my users have permissions to access and create tables data but on some databases I'm just g...
- Web Console not showing Database Docs, b...
We have a User collection within Database. So Auth::User connects to Database::User. When we signup a user using apple sub, the Database::User is created, alo...
