File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
packages/runtime/src/enhancements/node/policy Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,14 @@ export class PolicyProxyHandler<DbClient extends DbClientContract> implements Pr
140140 return handleRejection ( ) ;
141141 }
142142
143+ if ( isList && ! this . policyUtils . injectForList ( this . prisma , this . model , _args ) ) {
144+ if ( this . shouldLogQuery ) {
145+ this . logger . info ( `[policy] \`${ actionName } \` ${ this . model } : unconditionally denied` ) ;
146+ }
147+
148+ return handleRejection ( ) ;
149+ }
150+
143151 this . policyUtils . injectReadCheckSelect ( this . model , _args ) ;
144152
145153 if ( this . shouldLogQuery ) {
Original file line number Diff line number Diff line change @@ -652,6 +652,14 @@ export class PolicyUtil extends QueryUtils {
652652 return true ;
653653 }
654654
655+ /**
656+ * Injects auth guard for read operations.
657+ */
658+ injectForList ( _db : CrudContract , _model : string , _args : any ) {
659+ // make select and include visible to the injection
660+ return true ;
661+ }
662+
655663 //#endregion
656664
657665 //#region Checker
You can’t perform that action at this time.
0 commit comments