Skip to content

Commit

Permalink
Add ability to move content from one tenant to another (#25)
Browse files Browse the repository at this point in the history
* Add ability to move content between tenants

* fixes
  • Loading branch information
imsitnikov authored Nov 21, 2023
1 parent 7de0abb commit e57b3bd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/components/error-response-presenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,24 @@ export default (error: AppError | DBError) => {
},
};
}
case US_ERRORS.MOVE_TENANT_CONTENT_DENIED: {
return {
code: 403,
response: {
code,
message: message ?? 'Move tenant content denied',
},
};
}
case US_ERRORS.MOVE_TENANT_CONTENT_ERROR: {
return {
code: 500,
response: {
code,
message: message ?? 'Move tenant content error',
},
};
}
default:
return {
code: 500,
Expand Down
2 changes: 2 additions & 0 deletions src/const/us-error-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ const US_ERRORS = {
ENTRY_IS_NOT_IN_WORKBOOK: 'ENTRY_IS_NOT_IN_WORKBOOK',
UNKNOWN_OPERATION_TYPE: 'UNKNOWN_OPERATION_TYPE',
IAM_OPERATION_NOT_EXISTS: 'IAM_OPERATION_NOT_EXISTS',
MOVE_TENANT_CONTENT_DENIED: 'MOVE_TENANT_CONTENT_DENIED',
MOVE_TENANT_CONTENT_ERROR: 'MOVE_TENANT_CONTENT_ERROR',
};

export const ERROR_BY_DLS_STATUS_CODE: {[key: number]: string} = {
Expand Down
2 changes: 1 addition & 1 deletion src/services/entry/actions/copy-to-workbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const copyToWorkbook = async (ctx: CTX, params: Params) => {

logInfo(ctx, 'COPY_ENTRY_TO_WORKBOOK_CALL', {
entryIds: entryIds.map((entryId) => Utils.encodeId(entryId)),
destinationWorkbookId,
destinationWorkbookId: Utils.encodeId(destinationWorkbookId),
tenantIdOverride,
});

Expand Down
2 changes: 1 addition & 1 deletion src/types/models/dls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export enum DlsActions {
Edit = 'edit',
SetPermissions = 'set_permissions',
}
enum DlsPermissions {
export enum DlsPermissions {
Execute = 'acl_execute',
Read = 'acl_view',
Write = 'acl_edit',
Expand Down

0 comments on commit e57b3bd

Please sign in to comment.