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
- I recently switched to TablesDb. When li...
olddb.list_documents( queries =[ Query.order_desc("timestamp"), Query.equal("isPosted",[False]) ] ) Above works fine and reruns documents But below don't return...
- Database error validating 'min' and 'max...
I keep seeing an error when I try to add a column to a database table within the AppWrite cloud UI. I also see this error when trying to create or update a reco...
- Cannot create cloud function due to this...
As I try to deploy a new function to Github I get this error message: ``` Unable to clone code repository: fatal: ' ' is not a valid branch name hint: See `man ...