[ARVADOS] updated: 12df2994c114b62b0d07a267fdeeaea389e5adb1

git at public.curoverse.com git at public.curoverse.com
Mon Oct 20 09:38:57 EDT 2014


Summary of changes:
 .../views/application/_title_and_buttons.html.erb    |  3 ++-
 apps/workbench/test/integration/projects_test.rb     | 20 ++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)

       via  12df2994c114b62b0d07a267fdeeaea389e5adb1 (commit)
      from  269adb302bf244332706a1fe053feddc402eb4be (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 12df2994c114b62b0d07a267fdeeaea389e5adb1
Author: radhika <radhika at curoverse.com>
Date:   Mon Oct 20 09:22:35 2014 -0400

    4026: admin user can move a project under another user's home project.

diff --git a/apps/workbench/app/views/application/_title_and_buttons.html.erb b/apps/workbench/app/views/application/_title_and_buttons.html.erb
index 4d54fd0..83d08f5 100644
--- a/apps/workbench/app/views/application/_title_and_buttons.html.erb
+++ b/apps/workbench/app/views/application/_title_and_buttons.html.erb
@@ -31,7 +31,8 @@
         <i class="fa fa-fw fa-copy"></i> Copy to project...
       <% end %>
     <% end %>
-    <% if @object.owner_uuid == current_user.uuid or (Group.find(@object.owner_uuid).writable_by.include?(current_user.uuid) rescue nil) %>
+    <% if @object.owner_uuid == current_user.uuid or current_user.is_admin or
+                                (Group.find(@object.owner_uuid).writable_by.include?(current_user.uuid) rescue nil) %>
       <%= link_to(
           choose_projects_path(
            title: "Move this #{object_class} to:",
diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index 83565f9..3bc7750 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -485,4 +485,24 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     end
   end
 
+  # Move button accessibility
+  [
+    ['admin', true],
+    ['active', true],  # project owner
+    ['project_viewer', false],
+    ].each do |user, can_move|
+    test "#{user} can move subproject under another user's Home #{can_move}" do
+      project = api_fixture('groups')['aproject']
+      collection = api_fixture('collections')['collection_to_move_around_in_aproject']
+
+      # verify the project move button
+      visit page_with_token user, "/projects/#{project['uuid']}"
+      if can_move
+        assert page.has_link? 'Move project...'
+      else
+        assert page.has_no_link? 'Move project...'
+      end
+    end
+  end
+
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list