Skip to content

Commit a976195

Browse files
committed
fix: Exit when trying to delete the super-admin role
1 parent b7cc366 commit a976195

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server/config/type.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ const ConfigType = class ConfigType {
5555
// Don't preform action when soft setting is true.
5656
if (softImport && !force) return false;
5757

58+
// Exit when trying to delete the super-admin role.
59+
if (this.configPrefix === 'admin-role' && configName === 'strapi-super-admin') {
60+
return false;
61+
}
62+
5863
await Promise.all(this.relations.map(async ({ queryString, parentName }) => {
5964
const relations = await noLimit(strapi.query(queryString), {
6065
where: {

0 commit comments

Comments
 (0)