4285: prepend './' to file path being retrieved when it is in a subdir in a collection.
[arvados.git] / apps / workbench / app / controllers / pipeline_instances_controller.rb
index 27e8f5b51b0e12eea2fc24fe523f7b4f88365f84..a618d435173b2a67db2cfcba3d5ef797db4cf8c0 100644 (file)
@@ -47,6 +47,13 @@ class PipelineInstancesController < ApplicationController
       component.delete :job
     end
     @object.state = 'New'
+
+    # set owner_uuid to that of source, provided it is a project and wriable by current user
+    current_project = Group.find(source.owner_uuid) rescue nil
+    if (current_project && current_project.writable_by.andand.include?(current_user.uuid))
+      @object.owner_uuid = source.owner_uuid
+    end
+
     super
   end