Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Relational field update fails when user's role has granular permission #10746

Closed
3 tasks done
darioguarascio opened this issue Dec 29, 2021 · 1 comment
Closed
3 tasks done

Comments

@darioguarascio
Copy link

darioguarascio commented Dec 29, 2021

Preflight Checklist

Describe the Bug

A user with granular permission fails to add new rows in a table that has a M2O relationship.
As admin role, with all permissions set, everything works well.

The custom role has all permission set

To Reproduce

In table A there is a website field Many to One to website table and a simple text field name

I am accessing directus as user that has read/write/delete/update permission on table A where website -> name Equals x

When I try to add a new row to table A, selecting an entry from the website table with the M2O selector, I get the following error

{"errors":[{"message":"\"website\" must be of type object","extensions":{"code":"FAILED_VALIDATION","field":"website"}}]}

the data being posted is the following:

{
    "name": "test",
    "website": 37
}

Errors Shown

image

What version of Directus are you using?

9.4.0

What version of Node.js are you using?

16.13.1

What database are you using?

postgres:13

What browser are you using?

Chrome

What operating system are you using?

Linux 5.11.0-41-generic

How are you deploying Directus?

Docker

@darioguarascio
Copy link
Author

I have to add: updating an already existing row, with the restricted role, works ok (at least for non-relational fields)

@directus directus locked and limited conversation to collaborators Dec 30, 2021
@rijkvanzanten rijkvanzanten converted this issue into discussion #10771 Dec 30, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant