File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export class SubjectsService {
4141 } ) ;
4242 }
4343
44- async createMany ( data : CreateSubjectDto [ ] ) {
44+ async createMany ( data : CreateSubjectDto [ ] , { ability } : EntityOperationOptions = { } ) {
4545 //filter out all duplicate ids that are planned to be created via a set
4646 const noDuplicatesSet = new Set (
4747 data . map ( ( record ) => {
@@ -55,7 +55,8 @@ export class SubjectsService {
5555 const existingSubjects = await this . subjectModel . findMany ( {
5656 select : { id : true } ,
5757 where : {
58- id : { in : subjectIds }
58+ id : { in : subjectIds } ,
59+ AND : [ accessibleQuery ( ability , 'read' , 'Subject' ) ]
5960 }
6061 } ) ;
6162
@@ -76,7 +77,8 @@ export class SubjectsService {
7677 return subjectsToCreate ;
7778 }
7879 return this . subjectModel . createMany ( {
79- data : subjectsToCreate
80+ data : subjectsToCreate ,
81+ ...accessibleQuery ( ability , 'create' , 'Subject' )
8082 } ) ;
8183 }
8284
You can’t perform that action at this time.
0 commit comments