Skip to content

[Bug] Complex Access Policies change result data structure when using hooks #2283

@priyanka-sadhwani

Description

@priyanka-sadhwani

Description and expected behavior
When there is a complex access policy that traverses multiple tables, it seems like the fields used in the access policy are being retrieved in the query results even though they aren't specifically in the select fields.

In the example in my test repo linked below, I'm only trying to bring back the id and name of some of the models, but a lot of extra data is retrieved because of the complex access policies.

Expected behaviour:
I would expect the access policies to filter the results that are retrieved but not to change the structure of the data that I define via the parameters.

Actual behaviour:
The fields used in the access policies are also returned in the result.

Environment (please complete the following information):

  • ZenStack version: 2.11.4
  • Prisma version: 6
  • Database type: Postgresql

Issue recreated in this repo: https://github.com/priyanka-sadhwani/zenstack-test-bed
Follow README for setup.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions