|
|
|
@ -113,7 +113,7 @@ export class AtImportProcessor {
|
|
|
|
|
await sMapEM.init(); |
|
|
|
|
const userRole = syncDB.user.roles |
|
|
|
|
.split(',') |
|
|
|
|
.reduce((rolesObj, role) => ({ [role]: true, ...rolesObj }), {}); |
|
|
|
|
.reduce((rolesObj, role) => ({ [role]: true, ...rolesObj })); |
|
|
|
|
|
|
|
|
|
const sMap = { |
|
|
|
|
// static mapping records between aTblId && ncId
|
|
|
|
@ -666,7 +666,12 @@ export class AtImportProcessor {
|
|
|
|
|
const view = { list: [] }; |
|
|
|
|
view['list'] = await this.viewsService.viewList({ |
|
|
|
|
tableId: table.id, |
|
|
|
|
user: { roles: userRole }, |
|
|
|
|
user: { |
|
|
|
|
roles: userRole, |
|
|
|
|
project_roles: { |
|
|
|
|
owner: true, |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'dbView.list'); |
|
|
|
|
|
|
|
|
@ -745,7 +750,7 @@ export class AtImportProcessor {
|
|
|
|
|
const srcTbl: any = |
|
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
|
tableId: srcTableId, |
|
|
|
|
user: syncDB.user, |
|
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
@ -829,7 +834,7 @@ export class AtImportProcessor {
|
|
|
|
|
const childTblSchema: any = |
|
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
|
tableId: ncLinkMappingTable[x].nc.childId, |
|
|
|
|
user: syncDB.user, |
|
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
@ -837,7 +842,7 @@ export class AtImportProcessor {
|
|
|
|
|
const parentTblSchema: any = |
|
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
|
tableId: ncLinkMappingTable[x].nc.parentId, |
|
|
|
|
user: syncDB.user, |
|
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
@ -1734,7 +1739,12 @@ export class AtImportProcessor {
|
|
|
|
|
const viewList = { list: [] }; |
|
|
|
|
viewList['list'] = await this.viewsService.viewList({ |
|
|
|
|
tableId: tblId, |
|
|
|
|
user: { roles: userRole }, |
|
|
|
|
user: { |
|
|
|
|
roles: userRole, |
|
|
|
|
project_roles: { |
|
|
|
|
owner: true, |
|
|
|
|
}, |
|
|
|
|
} as any, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'dbView.list'); |
|
|
|
|
|
|
|
|
@ -1854,7 +1864,7 @@ export class AtImportProcessor {
|
|
|
|
|
const _perfStart = recordPerfStart(); |
|
|
|
|
const ncTbl: any = await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
|
tableId: tblId, |
|
|
|
|
user: syncDB.user, |
|
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
@ -2328,7 +2338,7 @@ export class AtImportProcessor {
|
|
|
|
|
ncTblList['list'] = await this.tablesService.getAccessibleTables({ |
|
|
|
|
projectId: ncCreatedProjectSchema.id, |
|
|
|
|
baseId: syncDB.baseId, |
|
|
|
|
roles: userRole, |
|
|
|
|
roles: { ...userRole, owner: true }, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'base.tableList'); |
|
|
|
|
|
|
|
|
@ -2348,7 +2358,7 @@ export class AtImportProcessor {
|
|
|
|
|
const ncTbl: any = |
|
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
|
tableId: ncTblList.list[i].id, |
|
|
|
|
user: syncDB.user, |
|
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
|
}); |
|
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
@ -2383,7 +2393,7 @@ export class AtImportProcessor {
|
|
|
|
|
const ncTbl: any = |
|
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
|
tableId: ncTblList.list[i].id, |
|
|
|
|
user: syncDB.user, |
|
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
rtc.data.nestedLinks += await importLTARData({ |
|
|
|
|