mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(editor): Add access control and not found entity views (#15860)
This commit is contained in:
committed by
GitHub
parent
24e4be1ece
commit
80a784a50c
@@ -468,8 +468,20 @@ async function initializeWorkspaceForExistingWorkflow(id: string) {
|
||||
|
||||
await projectsStore.setProjectNavActiveIdByWorkflowHomeProject(workflowData.homeProject);
|
||||
} catch (error) {
|
||||
toast.showError(error, i18n.baseText('openWorkflow.workflowNotFoundError'));
|
||||
if (error.httpStatusCode === 404) {
|
||||
return await router.replace({
|
||||
name: VIEWS.ENTITY_NOT_FOUND,
|
||||
params: { entityType: 'workflow' },
|
||||
});
|
||||
}
|
||||
if (error.httpStatusCode === 403) {
|
||||
return await router.replace({
|
||||
name: VIEWS.ENTITY_UNAUTHORIZED,
|
||||
params: { entityType: 'workflow' },
|
||||
});
|
||||
}
|
||||
|
||||
toast.showError(error, i18n.baseText('openWorkflow.workflowNotFoundError'));
|
||||
void router.push({
|
||||
name: VIEWS.NEW_WORKFLOW,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user