fix: Exit when trying to delete the super-admin role

pull/84/head
boazpoolman 2022-12-05 18:55:49 +01:00
parent b7cc366312
commit a9761955fe
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,11 @@ const ConfigType = class ConfigType {
// Don't preform action when soft setting is true. // Don't preform action when soft setting is true.
if (softImport && !force) return false; if (softImport && !force) return false;
// Exit when trying to delete the super-admin role.
if (this.configPrefix === 'admin-role' && configName === 'strapi-super-admin') {
return false;
}
await Promise.all(this.relations.map(async ({ queryString, parentName }) => { await Promise.all(this.relations.map(async ({ queryString, parentName }) => {
const relations = await noLimit(strapi.query(queryString), { const relations = await noLimit(strapi.query(queryString), {
where: { where: {