You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Cerbos policies it is possible to check for intersections of list elements, and make decisions based on hasIntersection.
It would be a great addition to relational queries and scalar lists to support this operation also for the Query Plan Adapter for Prisma ORM.
E.g. Entities with scalar lists or one-to-many / many-to-many relations could be checked for common attributes between principal and resource definition.
What would the ideal solution look like to you?
It would be ideal if the hasIntersection operation could be handled like other supported operations.
Who it could look like as an inspiration:
Relational:
model Resource {
id String @id @default(cuid())
aString String
aNumber Int
aBool Boolean
ownedBy User[]
createdBy User @relation(fields: [creatorId], references: [id], name: "creator")
creatorId String
nested NestedResource @relation(fields: [nestedResourceId], references: [id])
nestedResourceId String
tags Tag[]. // new tags relation field
}
model Tag {
id String @id @default(cuid())
value String
resources Resource[] // new resources relation field
}
Is there an existing issue for this?
Feature description
With Cerbos policies it is possible to check for intersections of list elements, and make decisions based on
hasIntersection
.It would be a great addition to relational queries and scalar lists to support this operation also for the Query Plan Adapter for Prisma ORM.
E.g. Entities with scalar lists or one-to-many / many-to-many relations could be checked for common attributes between principal and resource definition.
What would the ideal solution look like to you?
It would be ideal if the hasIntersection operation could be handled like other supported operations.
Who it could look like as an inspiration:
Relational:
Scalar List: https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-scalar-lists-arrays
Cerbos Policy
Principal:
The resulting Prisma filter objects should look like:
Relational:
Scalar List:
The text was updated successfully, but these errors were encountered: