Skip to content

Commit

Permalink
Allow getWorkbook for mirrored entries
Browse files Browse the repository at this point in the history
  • Loading branch information
bt4R9 committed Dec 8, 2023
1 parent ce1cb0e commit 4382986
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/new/workbook/get-workbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const getWorkbook = async <T extends WorkbookInstance = WorkbookInstance>
validateArgs(args);
}

const {tenantId, projectId, isPrivateRoute} = ctx.get('info');
const {tenantId, projectId, isPrivateRoute, onlyMirrored} = ctx.get('info');

const {accessServiceEnabled} = ctx.config;

Expand All @@ -55,7 +55,7 @@ export const getWorkbook = async <T extends WorkbookInstance = WorkbookInstance>
.where({
[WorkbookModelColumn.DeletedAt]: null,
[WorkbookModelColumn.WorkbookId]: workbookId,
...(isPrivateRoute
...(isPrivateRoute || onlyMirrored
? {}
: {
[WorkbookModelColumn.TenantId]: tenantId,
Expand All @@ -78,7 +78,7 @@ export const getWorkbook = async <T extends WorkbookInstance = WorkbookInstance>
model,
});

if (accessServiceEnabled && !skipCheckPermissions && !isPrivateRoute) {
if (accessServiceEnabled && !skipCheckPermissions && !isPrivateRoute && !onlyMirrored) {
let parentIds: string[] = [];

if (workbook.model.collectionId !== null) {
Expand Down

0 comments on commit 4382986

Please sign in to comment.