feat: refactoring casl permission checks for recursive nested operations (#778)
* feat: nested casl abilities * fix: remove unused packages * Fixes * Fix createMany broken * Fix lint * Fix lint * Fix lint * Fix lint * Fixes * Fix CommentThread * Fix bugs * Fix lint * Fix bugs * Fixed auto routing * Fixed app path --------- Co-authored-by: Charles Bochet <charles@twenty.com> Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -1,9 +1,5 @@
|
||||
import { Test, TestingModule } from '@nestjs/testing';
|
||||
import { CanActivate } from '@nestjs/common';
|
||||
|
||||
import { UpdateOneGuard } from 'src/guards/update-one.guard';
|
||||
import { DeleteManyGuard } from 'src/guards/delete-many.guard';
|
||||
import { CreateOneGuard } from 'src/guards/create-one.guard';
|
||||
import { AbilityFactory } from 'src/ability/ability.factory';
|
||||
|
||||
import { PersonService } from './person.service';
|
||||
@ -13,8 +9,6 @@ describe('PersonResolver', () => {
|
||||
let resolver: PersonResolver;
|
||||
|
||||
beforeEach(async () => {
|
||||
const mockGuard: CanActivate = { canActivate: jest.fn(() => true) };
|
||||
|
||||
const module: TestingModule = await Test.createTestingModule({
|
||||
providers: [
|
||||
PersonResolver,
|
||||
@ -27,14 +21,7 @@ describe('PersonResolver', () => {
|
||||
useValue: {},
|
||||
},
|
||||
],
|
||||
})
|
||||
.overrideGuard(UpdateOneGuard)
|
||||
.useValue(mockGuard)
|
||||
.overrideGuard(DeleteManyGuard)
|
||||
.useValue(mockGuard)
|
||||
.overrideGuard(CreateOneGuard)
|
||||
.useValue(mockGuard)
|
||||
.compile();
|
||||
}).compile();
|
||||
|
||||
resolver = module.get<PersonResolver>(PersonResolver);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user