8000 🐛 Bug Report: users cannot update documents where they have update permissions when there is a relationship · Issue #5852 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
🐛 Bug Report: users cannot update documents where they have update permissions when there is a relationship #5852
Closed
@t0mm4rx

Description

@t0mm4rx

👟 Reproduction steps

Hello,

I have collections A and B. Both have document security enabled.
A has a one-to-many relationship attribute with B.

X is a document in A, the user has update rights.
Z is a document in B, the user has update rights.

Z is inside of X.

When updating a field of X, the user gets a 401. Here are the logs of the appwrite container:

[Error] Method: PATCH
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: Appwrite\Extend\Exception
[Error] Message: The current user is not authorized to perform the requested action.
[Error] File: /usr/src/code/app/controllers/api/databases.php
[Error] Line: 3295

The error is thrown in this block code:

throw new Exception(Exception::USER_UNAUTHORIZED);

This block is check for !$documentSecurity, and both collection has documentSecurity enabled, so it might be an error done while computing this variable.

Here is a Discord post discussing the issue: https://ptb.discord.com/channels/564160730845151244/1125081645322604554

👍 Expected behavior

The user should be able to update its document.

👎 Actual Behavior

The user cannot update the document where he has the rights to.

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

Self-deployed 1.3.7.

👀 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?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfeature / relationshipsFixes and upgrades for database relationshipsproduct / databasesFixes and upgrades for the Appwrite Database.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0