X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/2129d2a8fc553a0e89b374bdad2226ff3b3d377e..46c5d0d6ab1e39af6a8c12a7d620e0b03cde8a53:/src/store/workflow-panel/workflow-panel-actions.ts diff --git a/src/store/workflow-panel/workflow-panel-actions.ts b/src/store/workflow-panel/workflow-panel-actions.ts index 85f0b9bc..7c90fa6b 100644 --- a/src/store/workflow-panel/workflow-panel-actions.ts +++ b/src/store/workflow-panel/workflow-panel-actions.ts @@ -18,6 +18,7 @@ import { RUN_PROCESS_ADVANCED_FORM } from 'views/run-process-panel/run-process-a import { getResource, ResourcesState } from 'store/resources/resources'; import { ProjectResource } from 'models/project'; import { UserResource } from 'models/user'; +import { getUserUuid } from "common/getuser"; export const WORKFLOW_PANEL_ID = "workflowPanel"; const UUID_PREFIX_PROPERTY_NAME = 'uuidPrefix'; @@ -55,8 +56,15 @@ export const openRunProcess = (workflowUuid: string, ownerUuid?: string, name?: dispatch(initialize(RUN_PROCESS_ADVANCED_FORM, getWorkflowRunnerSettings(workflow))); let owner; if (ownerUuid) { - dispatch(runProcessPanelActions.SET_PROCESS_OWNER_UUID(ownerUuid)); + // Must be writable. + const userUuid = getUserUuid(getState()); owner = getResource(ownerUuid)(getState().resources); + if (!owner || !userUuid || owner.writableBy.indexOf(userUuid) === -1) { + owner = undefined; + } + } + if (owner) { + dispatch(runProcessPanelActions.SET_PROCESS_OWNER_UUID(owner.uuid)); } dispatch(initialize(RUN_PROCESS_BASIC_FORM, { name, owner }));