X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/5da46a24f0381fb708e8b06f8daba6c9df6cd274..dab6ac81df3cb99f1eb0edbddc07d731dfd61eb1:/src/views/run-process-panel/inputs/project-input.tsx

diff --git a/src/views/run-process-panel/inputs/project-input.tsx b/src/views/run-process-panel/inputs/project-input.tsx
index 97028fc97c..d91a6b8483 100644
--- a/src/views/run-process-panel/inputs/project-input.tsx
+++ b/src/views/run-process-panel/inputs/project-input.tsx
@@ -24,7 +24,7 @@ export type ProjectCommandInputParameter = GenericCommandInputParameter<ProjectR
 const require: any = (value?: ProjectResource) => (value === undefined);
 
 export interface ProjectInputProps {
-    required?: boolean;
+    required: boolean;
     input: ProjectCommandInputParameter;
     options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
 }
@@ -39,7 +39,8 @@ export const ProjectInput = ({ required, input, options }: ProjectInputProps) =>
         format={format}
         validate={required ? require : undefined}
         {...{
-            options
+            options,
+            required
         }} />;
 
 const format = (value?: ProjectResource) => value ? value.name : '';
@@ -58,6 +59,7 @@ const mapStateToProps = (state: RootState) => ({ userUuid: getUserUuid(state) })
 export const ProjectInputComponent = connect(mapStateToProps)(
     class ProjectInputComponent extends React.Component<GenericInputProps & DispatchProp & HasUserUuid & {
         options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
+        required?: boolean;
     }, ProjectInputComponentState> {
         state: ProjectInputComponentState = {
             open: false,
@@ -97,7 +99,7 @@ export const ProjectInputComponent = connect(mapStateToProps)(
             }
         }
 
-        invalid = () => (!this.state.project || this.state.project.writableBy.indexOf(this.props.userUuid) === -1);
+        invalid = () => (!this.state.project || !this.state.project.canWrite);
 
         renderInput() {
             return <GenericInput
