[ARVADOS] updated: ec07cd1ad893c15d94844b3cf2d8d95ae5cfd611

git at public.curoverse.com git at public.curoverse.com
Wed May 28 12:02:19 EDT 2014


Summary of changes:
 apps/workbench/app/assets/javascripts/event_log.js |  45 +++++
 .../app/assets/javascripts/pipeline_instances.js   |  26 +++
 .../app/assets/javascripts/select_modal.js         |  39 ++++
 .../app/assets/stylesheets/folders.css.scss        |  16 +-
 .../app/assets/stylesheets/select_modal.css.scss   |   3 +
 .../app/controllers/application_controller.rb      |  24 +--
 .../app/controllers/collections_controller.rb      |  12 +-
 .../app/controllers/folders_controller.rb          |  65 ++++---
 .../app/helpers/pipeline_instances_helper.rb       |  20 ++
 apps/workbench/app/models/arvados_base.rb          |  13 +-
 apps/workbench/app/views/collections/show.html.erb |   2 +-
 apps/workbench/app/views/folders/_choose.html.erb  |  42 +++++
 apps/workbench/app/views/folders/_choose.js.erb    |   8 +
 .../app/views/folders/_show_folders.html.erb       |  29 +++
 .../app/views/folders/_show_my_folders.html.erb    |   2 -
 .../views/folders/_show_shared_with_me.html.erb    |   2 -
 apps/workbench/app/views/folders/show.html.erb     |  35 +++-
 .../app/views/layouts/application.html.erb         |  18 +-
 .../pipeline_instances/_show_components.html.erb   |  48 ++++-
 .../_show_components_editable.html.erb             |   2 +-
 apps/workbench/config/routes.rb                    |   1 +
 apps/workbench/test/integration/folders_test.rb    |  41 ++++-
 .../tutorial-firstscript.html.textile.liquid       |  10 +-
 sdk/cli/bin/arv-run-pipeline-instance              |   5 +-
 sdk/go/src/arvados.org/keepclient/keepclient.go    |  66 ++++++-
 .../src/arvados.org/keepclient/keepclient_test.go  |  17 +-
 sdk/go/src/arvados.org/keepclient/support.go       |  26 ++-
 .../main/java/org/arvados/sdk/java/Arvados.java    | 111 ++++++++---
 .../java/org/arvados/sdk/java/ArvadosTest.java     |  72 ++++++--
 sdk/python/arvados/api.py                          |   5 +-
 sdk/python/arvados/errors.py                       |   2 +
 sdk/python/arvados/keep.py                         | 103 ++++++++---
 sdk/python/run_test_server.py                      |  70 ++++++-
 sdk/python/test_keep_client.py                     | 202 +++++++++++++++++++++
 services/api/app/models/arvados_model.rb           |  13 +-
 services/api/app/models/group.rb                   |  16 ++
 services/api/script/crunch-dispatch.rb             |  50 +++--
 services/api/test/integration/websocket_test.rb    |   2 +-
 .../keep/src/arvados.org/keepproxy/keepproxy.go    |  84 +++++++--
 .../src/arvados.org/keepproxy/keepproxy_test.go    | 123 ++++++++++---
 services/keep/src/keep/handler_test.go             |  25 ++-
 services/keep/src/keep/keep.go                     |  99 ++++++++--
 services/keep/src/keep/keep_test.go                |   1 +
 services/keep/src/keep/perms.go                    |   2 +-
 44 files changed, 1321 insertions(+), 276 deletions(-)
 create mode 100644 apps/workbench/app/assets/javascripts/event_log.js
 create mode 100644 apps/workbench/app/assets/javascripts/select_modal.js
 create mode 100644 apps/workbench/app/assets/stylesheets/select_modal.css.scss
 create mode 100644 apps/workbench/app/views/folders/_choose.html.erb
 create mode 100644 apps/workbench/app/views/folders/_choose.js.erb
 create mode 100644 apps/workbench/app/views/folders/_show_folders.html.erb
 delete mode 100644 apps/workbench/app/views/folders/_show_my_folders.html.erb
 delete mode 100644 apps/workbench/app/views/folders/_show_shared_with_me.html.erb

       via  ec07cd1ad893c15d94844b3cf2d8d95ae5cfd611 (commit)
       via  747aa7b4d080b4ea95bf7d6d8643c43e70966f33 (commit)
       via  68f03bd3db859e60237507ec08c789a2c3a89ca9 (commit)
       via  fbb501e3c0efb10851c00a91c0538bedb8c5e454 (commit)
       via  ab5ff91383be492d5a5bcbfdcc008cb32f37a03d (commit)
       via  16413f6ebe1bba3a070cdff3d7436ad508db8514 (commit)
       via  319cc7b3862ff831798f92bcb2f0c921d208147d (commit)
       via  7199f034c15930a3a733e526e12fa93df7f9d4fb (commit)
       via  4d50cea3609918775bf2a07981f1ef719067502b (commit)
       via  fd7ac9bf21002cc8a3cdb9a5e16c588ff734dfab (commit)
       via  a5f005b1b1175771ea708daee632a76f502eb9e6 (commit)
       via  fba94dcc012a22c48b2b3b3bc9b0e134d605e725 (commit)
       via  7c810a0a2ad922e1bf966c026a96327c03ded77f (commit)
       via  30228998e995720e4c2e1a3f0b52be231d9fbb9a (commit)
       via  7ca1a382f7c59e29a03c765a6542f95a31ecdd07 (commit)
       via  93901e794e11dbb5717288b006714fac7d13cb21 (commit)
       via  1113b89204db5201806d03ecedaa99f177a91a2d (commit)
       via  a8da71bb7b0c4f319afd50ee6cd5d593f1237d33 (commit)
       via  facb17a2885e6b6d3e998e15862a3c6e970e8cf1 (commit)
       via  f60b9d7057fef32a7b61ea4de55b3d95b5b28f6c (commit)
       via  037ec427df8bb32953f5158d0cd9d074ace776e8 (commit)
       via  010a56c1ac501c8ae18b71198d53c17e60f9d9e3 (commit)
       via  8e60aa5c834a1a2a741a87a8155b8db9b4c46da3 (commit)
       via  a1e0f75938c65b827396e6796e9ccb99eecfe608 (commit)
       via  c61379a97dd46273da01792a83f4cae9736d6adf (commit)
       via  2b2adb421b9b82b75fe8a635442dfe8e1fab775a (commit)
       via  c3b30a4104264f78088133b7d758e1920b1525af (commit)
       via  69a1f282ad2983d36bd8fb7c41c681e1baa5dfa1 (commit)
       via  a8749c6b2c7d339c3355dd130ca37c9c876f72a5 (commit)
       via  86680eab88b02d7f8bfe2f76308668957c825c36 (commit)
       via  f7a3e11f6017b329bb381f7ef10f9bae9dcece8f (commit)
       via  9c4c0fd4015865e8f2f9f9c9867c7d847cd34aeb (commit)
       via  f4b7ce1ad093bd4c131ee603d053a329f003b754 (commit)
       via  6df740c374ba869fd2aba618ab6d26ef641b6efd (commit)
       via  6abd2d88cce48e0c5f908ed584cd5f575a82de90 (commit)
       via  8633979010e2f15b3b88cab2a610019a336745c7 (commit)
       via  31acc5982c7f002944e1c8cecf83ca98cc3c3e76 (commit)
       via  1e0a693f16e599bb05a11933154da0f73030ecf7 (commit)
       via  e96a00962a6f5fcf65529630e4f2850fbfde2b73 (commit)
       via  f36fe36bd5e64b55b8699fae187c6accb678db2b (commit)
       via  5cdf402cfc23ad287f1570b9db19a72a64b91fdc (commit)
       via  39e38f830e8a12c93d5a788d15a5834b6f911217 (commit)
       via  d269c98c322e0a65ef36730e6a57c98a1ed754fa (commit)
       via  b25c3bd978ccc68b42b3b68392863456fe4441fa (commit)
       via  7c8e4a8d357ad8140eab83687c36cafd4e110e71 (commit)
       via  521457373a8f1e46f44a43311be2d9242ad5d0a9 (commit)
       via  56d21dc3d5823117729df3db6186da96f277b328 (commit)
       via  7a82503a45c632918f8f032913dbbf6711a02e2e (commit)
       via  c0c0d769cd812e87efa392649380dc5ba8a25cd4 (commit)
       via  ed101805b04c70bcbf1b070dceba2aee72170377 (commit)
       via  27ffca811e6f43225fc82d582d1962eebbd1ab6e (commit)
       via  b646cec74484bf07a54f4be2de712f50dc387aa0 (commit)
       via  0d35501f448a8e7ca44152429d3d38edaa9bb30c (commit)
       via  f3dd3608f2c32fd4dcd9551bfa1b871d816954d5 (commit)
       via  8efba7f42f882b2126a15e1bbcf385a5ab207b11 (commit)
       via  8e5db2221d848c35e751b932da8126b559d292f0 (commit)
       via  43a2aef67a96033f54e9f19cd9788e059e72115a (commit)
       via  c95e2762749ac2eb98fd7aec45134549174213d8 (commit)
       via  12f8c88325daf4c6af8cbf091ea64cc5d64566c0 (commit)
       via  575457ac8645c61ca71e94ce074291ec002b4c24 (commit)
       via  be92cf19aa7b61576ddcee0fd360103ca43ef5ea (commit)
       via  67492abc51acc09abec9e754fc1d845679db3e87 (commit)
       via  49a6ced3c7a540a7da7155ab1c3120a5227c620c (commit)
       via  86dffe03ec74387d14da9ceb17934bbdab1239b9 (commit)
       via  178f2834f7c9585485df30b1fe0e53b27e4edac5 (commit)
       via  fff404a0e2ebe2582f616526c486ad0dbecce3c8 (commit)
       via  66f1be77149feb033e3adc17c37a09a391eec6e9 (commit)
       via  2d4553d3d8e6f4d2e8f17e21664d46607a11dfb8 (commit)
       via  2328a5363e90f2588113cc6ea76329ef93197ca0 (commit)
       via  c66b82f901113491f8a16a046ee52fb40d8d2939 (commit)
       via  84decc8949fc51ec2eaf906fc2c4cbbb3df807dd (commit)
       via  5aac4c685edaa685c255dcf79aefde46c267e6d7 (commit)
       via  8ab98660dfc1973cced8b1deed355336cf4c5e64 (commit)
       via  540dbe405430bc8d58a07cfff141b4b4bc9811c1 (commit)
       via  ea17ec3d053bd2f792730c5ea74d03109ef942ce (commit)
       via  a46ebd3da9f41522abde23685bba92f538f76f03 (commit)
       via  8f20c1723c0614fabedb2c2468932d9245a1fc86 (commit)
       via  77504f6d369bd7bd323748d5347d6d99ed9c75ca (commit)
       via  f8743ac8fa1ed9dc8c7c4f7a23803ffe8721cfa6 (commit)
       via  b64b0a4082eeba5d17705dca3bedf53b99ded617 (commit)
       via  77d3ed33f525bd6859580954c6d7b9b36b394b98 (commit)
       via  4d1e1b22d470d2fec9078c64c058c69850e440d6 (commit)
       via  bbaa4e880fd232bd270644bff24e33eb06784f85 (commit)
       via  e5b58426fb9064da76b207cd6d8aaaff05331d64 (commit)
       via  b0d3b048f6f16dd80e119623e0d4cb558a6537f7 (commit)
       via  7d2ce5fa717f587963f64e466a9c3dd33faef27b (commit)
       via  0c5de14523d1e90297c091675ee621ce6664f65b (commit)
       via  cdec3d68520096ca95a66f73ecf22bb0b22363a1 (commit)
       via  86a02fd0842381002c46b590d774c561dbbaf19a (commit)
       via  aa7ec423d92b977320cc5708bd9556021d50d77a (commit)
       via  a84be631958ac0bb45b5e06efdb2782f02fdb2af (commit)
       via  c08254d5d6afcb5104cd65109d16479bf44ebb85 (commit)
       via  8a4b7ab667a30f883dfeb0892f9fe03defc47a8f (commit)
       via  d07841a4b10d5677a6e4f80df1ba4f1a8bd13be9 (commit)
       via  94abf66ab822425b025b8c88ebf9a2754b776ac3 (commit)
       via  1b6c6a52d0bba5b0a03524c7477ee9e8836c5f5b (commit)
       via  5cf70c36dd291410cdf177786a1a0ea0c25c06cb (commit)
       via  e6805dea66e86c6cdad036407f16fe17f45b8f94 (commit)
       via  6ea7ba8654f7620a5e0ba4f66d653026b3f002fe (commit)
       via  e35566eddb0c1e383e437e95b228f7898e7a1c16 (commit)
       via  f2574ec2e4ddef03c9504cd58741e73426ea1b17 (commit)
       via  e2eca205db4e40de582117790b1e48dbf3e5bf3a (commit)
       via  548f183c23606b9febcadbbfd658aa921c3baaf5 (commit)
       via  f5339841222a2ac17d3c04d4e9912c0608041b2f (commit)
       via  eb8eaafa2351d8cb8d4ba7408e0052d47fd56a2f (commit)
       via  675118822f0a9968672dd99320d9b3494bc2b148 (commit)
       via  243a6df519ee539ad9e5476cd6fcb51e4b0a48fe (commit)
       via  b1c303302dbac2ea6e9ab6775aecaf661b5da9c8 (commit)
       via  5c2372f1e53184a60d9e1366d26ce41bf405a0a9 (commit)
       via  465b105b0282efcdd63d88e1fb4e2eae11a195bc (commit)
       via  9e0031c0bf48acdb76118ee643290d97a94926de (commit)
       via  a8ebe9f478e897334af0fcda79704de77c4dcea6 (commit)
       via  264b0a629a67888a9d982b3a4398c0e0e4119089 (commit)
      from  651638a28db20a2016dff02e3baa106ab27ff945 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit ec07cd1ad893c15d94844b3cf2d8d95ae5cfd611
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed May 28 11:19:37 2014 -0400

    2044: Fixed CollectionsController#search_scopes to use 'filter' correctly
    instead of using 'where' incorrectly.  Reverted most changes to
    ArvadosModel#ensure_owner_uuid_is_permitted.  Added rescue to
    collections/show.html.erb when log.event_at is nil.

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 1d71041..f1fd092 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -125,7 +125,7 @@ class CollectionsController < ApplicationController
   end
 
   def search_scopes
-    ApiClientAuthorization.where(filters: [['scopes', '=', sharing_scopes]])
+    ApiClientAuthorization.filter([['scopes', '=', sharing_scopes]]).results
   end
 
   def show
@@ -150,7 +150,7 @@ class CollectionsController < ApplicationController
         .where(head_uuid: @object.uuid, tail_uuid: current_user.uuid,
                link_class: 'resources', name: 'wants')
         .results.any?
-      @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+      @search_sharing = search_scopes
     end
     @prov_svg = ProvenanceHelper::create_provenance_graph(@object.provenance, "provenance_svg",
                                                           {:request => request,
@@ -164,7 +164,7 @@ class CollectionsController < ApplicationController
   end
 
   def sharing_popup
-    @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+    @search_sharing = search_scopes
     respond_to do |format|
       format.html
       format.js
@@ -179,16 +179,16 @@ class CollectionsController < ApplicationController
 
   def share
     a = ApiClientAuthorization.create(scopes: sharing_scopes)
-    @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+    @search_sharing = search_scopes
     render 'sharing_popup'
   end
 
   def unshare
-    @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+    @search_sharing = search_scopes
     @search_sharing.each do |s|
       s.destroy
     end
-    @search_sharing = search_scopes.select { |s| s.scopes != ['all'] }
+    @search_sharing = search_scopes
     render 'sharing_popup'
   end
 
diff --git a/apps/workbench/app/views/collections/show.html.erb b/apps/workbench/app/views/collections/show.html.erb
index 0be6705..04c36d4 100644
--- a/apps/workbench/app/views/collections/show.html.erb
+++ b/apps/workbench/app/views/collections/show.html.erb
@@ -57,7 +57,7 @@
           <%= render_arvados_object_list_start(@logs, 'Show all activity',
                 logs_path(filters: [['object_uuid','=', at object.uuid]].to_json)) do |log| %>
           <p>
-          <%= time_ago_in_words(log.event_at) %> ago: <%= log.summary %>
+          <%= time_ago_in_words(log.event_at) rescue 'unknown time' %> ago: <%= log.summary %>
             <% if log.object_uuid %>
             <%= link_to_if_arvados_object log.object_uuid, link_text: raw('<i class="fa fa-hand-o-right"></i>') %>
             <% end %>
diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index adff09d..9700dd1 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -197,10 +197,21 @@ class ArvadosModel < ActiveRecord::Base
           current_user.can? write: self.owner_uuid
         # current_user is, or has :write permission on, the new owner
       else
-        logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_uuid_was}"
+        logger.warn "User #{current_user.uuid} tried to change owner_uuid of #{self.class.to_s} #{self.uuid} to #{self.owner_uuid} but does not have permission to write to #{self.owner_uuid}"
         raise PermissionDeniedError
       end
     end
+    if new_record?
+      return true
+    elsif current_user.uuid == self.owner_uuid_was or
+        current_user.uuid == self.uuid or
+        current_user.can? write: self.owner_uuid_was
+      # current user is, or has :write permission on, the previous owner
+      return true
+    else
+      logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_uuid_was}"
+      raise PermissionDeniedError
+    end
   end
 
   def ensure_permission_to_save

commit 747aa7b4d080b4ea95bf7d6d8643c43e70966f33
Merge: 651638a 68f03bd
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed May 28 10:53:23 2014 -0400

    Merge branch 'master' into 2044-share-button


-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list