
I have a problem with creating new documents (uploading post with video, image and text in my case), for every user such error occurs: The current user is not authorized to perform the requested action
Object for currently logged user:
{"$collectionId": "collectionId", "$createdAt": "2024-09-30T15:02:13.903+00:00", "$databaseId": "databaseId", "$id": "id", "$permissions": ["read(\"user:accountId\")", "update(\"user:accountId\")", "delete(\"user:accountId\")"], "$updatedAt": "2024-09-30T15:02:13.903+00:00", "accountId": "accountId", "avatar": "avatar_url", "email": "email", "username": "username"}
So as you can see, only read/update/delete permissions are present here. I was not able to add write
permission for any user, even though I have it checked in appwrite console for users' collection.
This is my react code for creating new users:
const newUser = await databases.createDocument(
databaseId,
usersCollectionId,
ID.unique(),
{
accountId: newAccount.$id,
email,
username,
avatar: avatarUrl,
},
[
Permission.read(Role.user(newAccount.$id)),
Permission.update(Role.user(newAccount.$id)),
Permission.delete(Role.user(newAccount.$id)),
Permission.write(Role.user(newAccount.$id)),
]
)
Previously, I have not added permissions as a paramter in createDocument
. The result was the same - it creates new user without write
permission. I'm also adding screenshot from appwrite console to show my permissions' settings for users' collection.
Recommended threads
- Flutter native Google Sign Up with googl...
Hey I want to use the native login instead of the WebView. Do you have any experience on that and has Appwrite to plan this support?
- How to upload a profile picture from rea...
I need to upload profile picture from a app i am building for my project... How do i do it ? Till now i have done this much but it shows an error
- After upgrading expo 52 to 53
Hello After upgrading my project from Expo SDK 52 to SDK 53, I encountered the following error when running the app: TurboModuleRegistry.getEnforcing(...): 'P...
