File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/plugins/policy/src Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -248,10 +248,15 @@ export class PolicyHandler<Schema extends SchemaDef> extends OperationNodeTransf
248248 if ( ! beforeUpdateAccessFields || beforeUpdateAccessFields . length === 0 ) {
249249 return undefined ;
250250 }
251+
252+ // combine update's where with policy filter
253+ const policyFilter = this . buildPolicyFilter ( model , model , 'update' ) ;
254+ const combinedFilter = where ? conjunction ( this . dialect , [ where . where , policyFilter ] ) : policyFilter ;
255+
251256 const query : SelectQueryNode = {
252257 kind : 'SelectQueryNode' ,
253258 from : FromNode . create ( [ TableNode . create ( model ) ] ) ,
254- where,
259+ where : WhereNode . create ( combinedFilter ) ,
255260 selections : [ ...beforeUpdateAccessFields . map ( ( f ) => SelectionNode . create ( ColumnNode . create ( f ) ) ) ] ,
256261 } ;
257262 const result = await proceed ( query ) ;
You can’t perform that action at this time.
0 commit comments