File tree Expand file tree Collapse file tree 3 files changed +76
-76
lines changed
runtime/src/enhancements/policy
schema/src/plugins/enhancer/enhance
tests/integration/tests/enhancements/with-policy Expand file tree Collapse file tree 3 files changed +76
-76
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ type FindOperations = 'findUnique' | 'findUniqueOrThrow' | 'findFirst' | 'findFi
4141// input arg type for `check` API
4242type PermissionCheckArgs = {
4343 operation : PolicyCrudKind ;
44- filter ?: Record < string , number | string | boolean > ;
44+ where ?: Record < string , number | string | boolean > ;
4545} ;
4646
4747/**
@@ -1466,11 +1466,11 @@ export class PolicyProxyHandler<DbClient extends DbClientContract> implements Pr
14661466 return constraint ;
14671467 }
14681468
1469- if ( args . filter ) {
1469+ if ( args . where ) {
14701470 // combine runtime filters with generated constraints
14711471
14721472 const extraConstraints : CheckerConstraint [ ] = [ ] ;
1473- for ( const [ field , value ] of Object . entries ( args . filter ) ) {
1473+ for ( const [ field , value ] of Object . entries ( args . where ) ) {
14741474 if ( value === undefined ) {
14751475 continue ;
14761476 }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export interface ModelCheckers {
3131
3232function generateDataModelChecker ( dataModel : DataModel ) {
3333 return `{
34- check(args: { operation: PolicyCrudKind, filter ?: ${ generateDataModelArgs ( dataModel ) } }): Promise<boolean>
34+ check(args: { operation: PolicyCrudKind, where ?: ${ generateDataModelArgs ( dataModel ) } }): Promise<boolean>
3535 }` ;
3636}
3737
You can’t perform that action at this time.
0 commit comments