Skip to content

Field level policies don't apply to relations on read #814

@tlancina

Description

@tlancina
  • ZenStack version: 1.2.0

It seems that

means that instead of calling this.hasFieldLevelPolicy(model) on the nested model it is using the hasFieldLevelPolicy of the parent, so no field level policies are applied.

We are using the pattern described in #809 to @deny all fields except one on our User model, and this appears to be leaking our entire user model when it is accessed via relation/include (edit - sorry I should emphasize that this is largely a non-issue since we are only selecting the field we need, I just noticed that in the default case the policies won't apply).

Happy to provide a reproduction if necessary.

Also - congrats on 1K stars! 🤩

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions