这是indexloc提供的服务,不要输入任何密码
Skip to content

[v2.0.0-alpha.10] Where condition not respecting permissions #6931

@renato

Description

@renato

I've recently upgraded from v1.3.3 to v2.0.0-alpha.10 and I'm facing some issues that didn't exist before, so I've setup a test instance on Heroku to isolate them. I can share the instance if needed, but it's easily reproducible.

I created a list_item table with a field product_id referencing product (id, name), with the proper foreign keys and relationships. On the permissions tab for list_item I have limited the number of rows to 0 and enabled the custom check {"product_id":{"_is_null":true}}. I've populated it with some test data.

However, this query:

{
  list_item {
    list
  }
  product(where: {list_items: {list: {_eq: "OWN"}}}) {
    id
    name
    list_items {
      list
    }
  }
}

Gives this result:

{
  "data": {
    "list_item": [],
    "product": [
      {
        "id": 1,
        "name": "Product 1",
        "list_items": []
      },
      {
        "id": 2,
        "name": "Product 2",
        "list_items": []
      }
    ]
  }
}

The list_item query returned empty, as it should, so did the list_items array relationship on the product. However, the product query shouldn't return any row as there's no row allowed for this role that matches the where condition.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions