|
|
@ -1070,17 +1070,26 @@ async function migrateUIAcl(ctx: MigrateCtxV1, ncMeta: any) { |
|
|
|
}> = await ncMeta.metaList(null, null, 'nc_disabled_models_for_role'); |
|
|
|
}> = await ncMeta.metaList(null, null, 'nc_disabled_models_for_role'); |
|
|
|
|
|
|
|
|
|
|
|
for (const acl of uiAclList) { |
|
|
|
for (const acl of uiAclList) { |
|
|
|
|
|
|
|
// if missing model name skip the view acl migration
|
|
|
|
|
|
|
|
if (!acl.title) continue; |
|
|
|
|
|
|
|
|
|
|
|
let fk_view_id; |
|
|
|
let fk_view_id; |
|
|
|
if (acl.type === 'vtable') { |
|
|
|
if (acl.type === 'vtable') { |
|
|
|
|
|
|
|
// if missing parent model name skip the view acl migration
|
|
|
|
|
|
|
|
if (!acl.parent_model_title) continue; |
|
|
|
fk_view_id = |
|
|
|
fk_view_id = |
|
|
|
ctx.objViewRef[acl.project_id][acl.parent_model_title][acl.title].id; |
|
|
|
ctx.objViewRef[acl.project_id]?.[acl.parent_model_title]?.[acl.title] |
|
|
|
|
|
|
|
?.id; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
fk_view_id = |
|
|
|
fk_view_id = |
|
|
|
ctx.objViewRef[acl.project_id][acl.title][ |
|
|
|
ctx.objViewRef?.[acl.project_id]?.[acl.title]?.[ |
|
|
|
ctx.objModelRef[acl.project_id][acl.title].title |
|
|
|
ctx.objModelRef?.[acl.project_id]?.[acl.title]?.title |
|
|
|
].id || ctx.objViewRef[acl.project_id][acl.title][acl.title].id; |
|
|
|
].id || ctx.objViewRef[acl.project_id]?.[acl.title]?.[acl.title]?.id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if view id missing skip ui acl view migration
|
|
|
|
|
|
|
|
if (!fk_view_id) continue; |
|
|
|
|
|
|
|
|
|
|
|
await ModelRoleVisibility.insert( |
|
|
|
await ModelRoleVisibility.insert( |
|
|
|
{ |
|
|
|
{ |
|
|
|
role: acl.role, |
|
|
|
role: acl.role, |
|
|
|