[ARVADOS] updated: 259fb182a339231b16c8eee1dd0bffe45b5483ea

git at public.curoverse.com git at public.curoverse.com
Mon Jul 28 19:25:57 EDT 2014


Summary of changes:
 services/api/app/controllers/arvados/v1/groups_controller.rb      | 3 +++
 services/api/test/fixtures/groups.yml                             | 2 +-
 services/api/test/functional/arvados/v1/groups_controller_test.rb | 7 +++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

       via  259fb182a339231b16c8eee1dd0bffe45b5483ea (commit)
      from  6c7373c9d66ab358ea48ea7c1d0e59551364e064 (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 259fb182a339231b16c8eee1dd0bffe45b5483ea
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jul 28 19:23:04 2014 -0400

    Do not return non-project groups in groups#contents. refs #3235

diff --git a/services/api/app/controllers/arvados/v1/groups_controller.rb b/services/api/app/controllers/arvados/v1/groups_controller.rb
index 98acbef..4a153cb 100644
--- a/services/api/app/controllers/arvados/v1/groups_controller.rb
+++ b/services/api/app/controllers/arvados/v1/groups_controller.rb
@@ -60,6 +60,9 @@ class Arvados::V1::GroupsController < ApplicationController
      Collection,
      Human, Specimen, Trait].each do |klass|
       @objects = klass.readable_by(*@read_users)
+      if klass == Group
+        @objects = @objects.where('group_class = ?', 'project')
+      end
       conds = []
       cond_params = []
       if opts[:owner_uuid]
diff --git a/services/api/test/fixtures/groups.yml b/services/api/test/fixtures/groups.yml
index 62b9958..c4ed133 100644
--- a/services/api/test/fixtures/groups.yml
+++ b/services/api/test/fixtures/groups.yml
@@ -66,7 +66,7 @@ asubproject:
   updated_at: 2014-04-21 15:37:48 -0400
   name: A Subproject
   description: "Test project belonging to active user's first test project"
-  group_class: folder
+  group_class: project
 
 future_project_viewing_group:
   uuid: zzzzz-j7d0g-futrprojviewgrp
diff --git a/services/api/test/functional/arvados/v1/groups_controller_test.rb b/services/api/test/functional/arvados/v1/groups_controller_test.rb
index 176e8e1..d6ac3ce 100644
--- a/services/api/test/functional/arvados/v1/groups_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/groups_controller_test.rb
@@ -61,6 +61,13 @@ class Arvados::V1::GroupsControllerTest < ActionController::TestCase
     kinds = json_response['items'].collect { |i| i['kind'] }.uniq
     expect_kinds = %w'arvados#group arvados#specimen arvados#pipelineTemplate arvados#job'
     assert_equal expect_kinds, (expect_kinds & kinds)
+
+    json_response['items'].each do |i|
+      if i['kind'] == 'arvados#group'
+        assert(i['group_class'] == 'project',
+               "group#contents returned a non-project group")
+      end
+    end
   end
 
   test 'get group-owned objects' do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list