mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
@@ -28,6 +28,12 @@ export class RolesService extends ItemsService {
|
||||
if (otherAdminRolesCount === 0) throw new UnprocessableEntityException(`You can't delete the last admin role.`);
|
||||
|
||||
await this.knex.transaction(async (trx) => {
|
||||
const itemsService = new ItemsService('directus_roles', {
|
||||
knex: trx,
|
||||
accountability: this.accountability,
|
||||
schema: this.schema,
|
||||
});
|
||||
|
||||
const permissionsService = new PermissionsService({
|
||||
knex: trx,
|
||||
accountability: this.accountability,
|
||||
@@ -66,7 +72,7 @@ export class RolesService extends ItemsService {
|
||||
}
|
||||
);
|
||||
|
||||
await super.deleteMany(keys);
|
||||
await itemsService.deleteMany(keys);
|
||||
});
|
||||
|
||||
return keys;
|
||||
|
||||
Reference in New Issue
Block a user