Skip to content

 [Feature Request] Support field comparison in access policy rules #476

Closed
@ymc9

Description

@ymc9

Today policy rules allow you to do comparisons but only one field can be involved in an expression, which means with:

model Foo {
  x Int
  y Int
}

@@allow(x > 0) is valid, but @@allow(x > y) is rejected at compile time.

Prisma has a preview feature called fieldReference which allows you to compare between fields in the same table. We can use that to relax some of the restrictions here.

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