Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: user unauthorized on update document #5747

Open
2 tasks done
Streissi opened this issue Jun 25, 2023 · 4 comments
Open
2 tasks done

🐛 Bug Report: user unauthorized on update document #5747

Streissi opened this issue Jun 25, 2023 · 4 comments
Assignees
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.

Comments

@Streissi
Copy link

Streissi commented Jun 25, 2023

👟 Reproduction steps

When I want to update a existing document in a collection i get following error:

[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: AppwriteException: user_unauthorized, The current user is not authorized to perform the requested action. (401)
#0      ClientMixin.prepareResponse
package:appwrite/src/client_mixin.dart:73
#1      ClientIO.call
package:appwrite/src/client_io.dart:373
<asynchronous suspension>
#2      Databases.updateDocument
package:appwrite/services/databases.dart:126
<asynchronous suspension>

the code where i want to update the document:

database.updateDocument(
        databaseId: dotenv.env['DATABASE_ID']!,
        collectionId: dotenv.env['EVENTS_COLLECTION_ID']!,
        documentId: event.eventId,
        data: {'users': event.userId},
      );

i don't have document security enabled only collection permissions are active and for all users they have read, write and update permission.

👍 Expected behavior

It should update the document.

👎 Actual Behavior

getting the error mentioned above.

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

I use a root server where appwrite version 1.3.7 runs in docker.

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@Streissi Streissi added the bug Something isn't working label Jun 25, 2023
@gepd
Copy link
Contributor

gepd commented Jun 28, 2023

What are the permission of that document or collection?

@joeyouss
Copy link

While you answer that, please take a look at this example: https://appwrite.io/docs/permissions#example-1

@Streissi
Copy link
Author

Streissi commented Jun 29, 2023 via email

@Streissi
Copy link
Author

Streissi commented Jun 29, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

No branches or pull requests

4 participants