Skip to content

@@deny comparing user in model and related model not working #786

@boptom

Description

@boptom

Taking the example here: https://zenstack.dev/docs/reference/zmodel-language#a-more-complex-example-with-multi-user-spaces

I would like to prevent deletions of the member who is also the space owner.

Within model Membership:

@@deny('delete', space.owner == user)

I would expect this would stop delete of the space owner's membership. However, the deletion is still allowed.

Is this related to the limitations here? https://zenstack.dev/docs/reference/limitations#comparison-between-fields-in-access-policies

If so, I apologise for this bug report, and suggest adding an example such as the above to this page.

Thanks!

  • ZenStack version: 1.1.1
  • Prisma version: 5.4.1
  • Database type: postgresql 15.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions