fix(core): Do not allow admins to delete the instance owner (#9489)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-05-22 16:23:40 +02:00
committed by GitHub
parent 88b9a4070b
commit fc83005ba0
2 changed files with 13 additions and 0 deletions

View File

@@ -168,6 +168,10 @@ export class UsersController {
);
}
if (userToDelete.role === 'global:owner') {
throw new ForbiddenError('Instance owner cannot be deleted.');
}
const personalProjectToDelete = await this.projectRepository.getPersonalProjectForUserOrFail(
userToDelete.id,
);