diff --git a/plugins/rbac-backend/migrations/20231221113214_migrations.js b/plugins/rbac-backend/migrations/20231221113214_migrations.js index a9d974de18..30b4c31125 100644 --- a/plugins/rbac-backend/migrations/20231221113214_migrations.js +++ b/plugins/rbac-backend/migrations/20231221113214_migrations.js @@ -13,10 +13,18 @@ exports.up = async function up(knex) { .where('ptype', 'g') .then(listGroupPolicies => { const allGroupPolicies = []; + let rbacFlag = false; for (const groupPolicy of listGroupPolicies) { const { v1 } = groupPolicy; + if (v1 === 'role:default/rbac_admin') { + rbacFlag = true; + continue; + } allGroupPolicies.push(v1); } + if (rbacFlag) { + allGroupPolicies.push('role:default/rbac_admin'); + } return allGroupPolicies; }); }