1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class Arvados::V1::GroupsControllerTest < ActionController::TestCase
9 test "attempt to delete group without read or write access" do
10 authorize_with :active
11 post :destroy, params: {id: groups(:empty_lonely_group).uuid}
15 test "attempt to delete group without write access" do
16 authorize_with :active
17 post :destroy, params: {id: groups(:all_users).uuid}
21 test "get list of projects" do
22 authorize_with :active
23 get :index, params: {filters: [['group_class', '=', 'project']], format: :json}
24 assert_response :success
26 json_response['items'].each do |group|
27 assert_equal 'project', group['group_class']
28 group_uuids << group['uuid']
30 assert_includes group_uuids, groups(:aproject).uuid
31 assert_includes group_uuids, groups(:asubproject).uuid
32 assert_includes group_uuids, groups(:private).uuid
33 assert_not_includes group_uuids, groups(:system_group).uuid
34 assert_not_includes group_uuids, groups(:private_and_can_read_foofile).uuid
37 test "get list of groups that are not projects" do
38 authorize_with :active
39 get :index, params: {filters: [['group_class', '!=', 'project']], format: :json}
40 assert_response :success
42 json_response['items'].each do |group|
43 assert_not_equal 'project', group['group_class']
44 group_uuids << group['uuid']
46 assert_not_includes group_uuids, groups(:aproject).uuid
47 assert_not_includes group_uuids, groups(:asubproject).uuid
50 test "get list of groups with bogus group_class" do
51 authorize_with :active
53 filters: [['group_class', '=', 'nogrouphasthislittleclass']],
56 assert_response :success
57 assert_equal [], json_response['items']
58 assert_equal 0, json_response['items_available']
61 def check_project_contents_response disabled_kinds=[]
62 assert_response :success
63 assert_operator 2, :<=, json_response['items_available']
64 assert_operator 2, :<=, json_response['items'].count
65 kinds = json_response['items'].collect { |i| i['kind'] }.uniq
66 expect_kinds = %w'arvados#group arvados#specimen arvados#pipelineTemplate arvados#job' - disabled_kinds
67 assert_equal expect_kinds, (expect_kinds & kinds)
69 json_response['items'].each do |i|
70 if i['kind'] == 'arvados#group'
71 assert(i['group_class'] == 'project',
72 "group#contents returned a non-project group")
76 disabled_kinds.each do |d|
77 assert_equal true, !kinds.include?(d)
81 test 'get group-owned objects' do
82 authorize_with :active
83 get :contents, params: {
84 id: groups(:aproject).uuid,
87 check_project_contents_response
90 test "user with project read permission can see project objects" do
91 authorize_with :project_viewer
92 get :contents, params: {
93 id: groups(:aproject).uuid,
96 check_project_contents_response
99 test "list objects across projects" do
100 authorize_with :project_viewer
101 get :contents, params: {
103 filters: [['uuid', 'is_a', 'arvados#specimen']]
105 assert_response :success
106 found_uuids = json_response['items'].collect { |i| i['uuid'] }
107 [[:in_aproject, true],
108 [:in_asubproject, true],
109 [:owned_by_private_group, false]].each do |specimen_fixture, should_find|
111 assert_includes found_uuids, specimens(specimen_fixture).uuid, "did not find specimen fixture '#{specimen_fixture}'"
113 refute_includes found_uuids, specimens(specimen_fixture).uuid, "found specimen fixture '#{specimen_fixture}'"
118 test "list trashed collections and projects" do
119 authorize_with :active
120 get(:contents, params: {
124 ['uuid', 'is_a', ['arvados#collection', 'arvados#group']],
125 ['is_trashed', '=', true],
129 assert_response :success
130 found_uuids = json_response['items'].collect { |i| i['uuid'] }
131 assert_includes found_uuids, groups(:trashed_project).uuid
132 refute_includes found_uuids, groups(:aproject).uuid
133 assert_includes found_uuids, collections(:expired_collection).uuid
134 refute_includes found_uuids, collections(:w_a_z_file).uuid
137 test "list objects in home project" do
138 authorize_with :active
139 get :contents, params: {
142 id: users(:active).uuid
144 assert_response :success
145 found_uuids = json_response['items'].collect { |i| i['uuid'] }
146 assert_includes found_uuids, specimens(:owned_by_active_user).uuid, "specimen did not appear in home project"
147 refute_includes found_uuids, specimens(:in_asubproject).uuid, "specimen appeared unexpectedly in home project"
150 test "list collections in home project" do
151 authorize_with :active
152 get(:contents, params: {
155 ['uuid', 'is_a', 'arvados#collection'],
158 id: users(:active).uuid,
160 assert_response :success
161 found_uuids = json_response['items'].collect { |i| i['uuid'] }
162 assert_includes found_uuids, collections(:collection_owned_by_active).uuid, "collection did not appear in home project"
163 refute_includes found_uuids, collections(:collection_owned_by_active_past_version_1).uuid, "collection appeared unexpectedly in home project"
166 test "list collections in home project, including old versions" do
167 authorize_with :active
168 get(:contents, params: {
170 include_old_versions: true,
172 ['uuid', 'is_a', 'arvados#collection'],
175 id: users(:active).uuid,
177 assert_response :success
178 found_uuids = json_response['items'].collect { |i| i['uuid'] }
179 assert_includes found_uuids, collections(:collection_owned_by_active).uuid, "collection did not appear in home project"
180 assert_includes found_uuids, collections(:collection_owned_by_active_past_version_1).uuid, "old collection version did not appear in home project"
183 test "user with project read permission can see project collections" do
184 authorize_with :project_viewer
185 get :contents, params: {
186 id: groups(:asubproject).uuid,
189 ids = json_response['items'].map { |item| item["uuid"] }
190 assert_includes ids, collections(:baz_file_in_asubproject).uuid
194 ['collections.name', 'asc', :<=, "name"],
195 ['collections.name', 'desc', :>=, "name"],
196 ['name', 'asc', :<=, "name"],
197 ['name', 'desc', :>=, "name"],
198 ['collections.created_at', 'asc', :<=, "created_at"],
199 ['collections.created_at', 'desc', :>=, "created_at"],
200 ['created_at', 'asc', :<=, "created_at"],
201 ['created_at', 'desc', :>=, "created_at"],
202 ].each do |column, order, operator, field|
203 test "user with project read permission can sort projects on #{column} #{order}" do
204 authorize_with :project_viewer
205 get :contents, params: {
206 id: groups(:asubproject).uuid,
208 filters: [['uuid', 'is_a', "arvados#collection"]],
209 order: "#{column} #{order}"
211 sorted_values = json_response['items'].collect { |item| item[field] }
213 # Here we avoid assuming too much about the database
214 # collation. Both "alice"<"Bob" and "alice">"Bob" can be
215 # correct. Hopefully it _is_ safe to assume that if "a" comes
216 # before "b" in the ascii alphabet, "aX">"bY" is never true for
217 # any strings X and Y.
218 reliably_sortable_names = sorted_values.select do |name|
219 name[0] >= 'a' && name[0] <= 'z'
223 # Preserve order of sorted_values. But do not use &=. If
224 # sorted_values has out-of-order duplicates, we want to preserve
225 # them here, so we can detect them and fail the test below.
226 sorted_values.select! do |name|
227 reliably_sortable_names.include? name
230 assert_sorted(operator, sorted_values)
234 def assert_sorted(operator, sorted_items)
235 actually_checked_anything = false
237 sorted_items.each do |entry|
239 assert_operator(previous, operator, entry,
240 "Entries sorted incorrectly.")
241 actually_checked_anything = true
245 assert actually_checked_anything, "Didn't even find two items to compare."
248 # Even though the project_viewer tests go through other controllers,
249 # I'm putting them here so they're easy to find alongside the other
251 def check_new_project_link_fails(link_attrs)
252 @controller = Arvados::V1::LinksController.new
253 post :create, params: {
255 link_class: "permission",
257 head_uuid: groups(:aproject).uuid,
260 assert_includes(403..422, response.status)
263 test "user with project read permission can't add users to it" do
264 authorize_with :project_viewer
265 check_new_project_link_fails(tail_uuid: users(:spectator).uuid)
268 test "user with project read permission can't add items to it" do
269 authorize_with :project_viewer
270 check_new_project_link_fails(tail_uuid: collections(:baz_file).uuid)
273 test "user with project read permission can't rename items in it" do
274 authorize_with :project_viewer
275 @controller = Arvados::V1::LinksController.new
276 post :update, params: {
277 id: jobs(:running).uuid,
278 name: "Denied test name",
280 assert_includes(403..404, response.status)
283 test "user with project read permission can't remove items from it" do
284 @controller = Arvados::V1::PipelineTemplatesController.new
285 authorize_with :project_viewer
286 post :update, params: {
287 id: pipeline_templates(:two_part).uuid,
289 owner_uuid: users(:project_viewer).uuid,
295 test "user with project read permission can't delete it" do
296 authorize_with :project_viewer
297 post :destroy, params: {id: groups(:aproject).uuid}
301 test 'get group-owned objects with limit' do
302 authorize_with :active
303 get :contents, params: {
304 id: groups(:aproject).uuid,
308 assert_response :success
309 assert_operator 1, :<, json_response['items_available']
310 assert_equal 1, json_response['items'].count
313 test 'get group-owned objects with limit and offset' do
314 authorize_with :active
315 get :contents, params: {
316 id: groups(:aproject).uuid,
321 assert_response :success
322 assert_operator 1, :<, json_response['items_available']
323 assert_equal 0, json_response['items'].count
326 test 'get group-owned objects with additional filter matching nothing' do
327 authorize_with :active
328 get :contents, params: {
329 id: groups(:aproject).uuid,
330 filters: [['uuid', 'in', ['foo_not_a_uuid','bar_not_a_uuid']]],
333 assert_response :success
334 assert_equal [], json_response['items']
335 assert_equal 0, json_response['items_available']
338 %w(offset limit).each do |arg|
339 ['foo', '', '1234five', '0x10', '-8'].each do |val|
340 test "Raise error on bogus #{arg} parameter #{val.inspect}" do
341 authorize_with :active
342 get :contents, params: {
343 :id => groups(:aproject).uuid,
352 test "Collection contents don't include manifest_text" do
353 authorize_with :active
354 get :contents, params: {
355 id: groups(:aproject).uuid,
356 filters: [["uuid", "is_a", "arvados#collection"]],
359 assert_response :success
360 refute(json_response["items"].any? { |c| not c["portable_data_hash"] },
361 "response included an item without a portable data hash")
362 refute(json_response["items"].any? { |c| c.include?("manifest_text") },
363 "response included an item with a manifest text")
366 test 'get writable_by list for owned group' do
367 authorize_with :active
369 id: groups(:aproject).uuid,
372 assert_response :success
373 assert_not_nil(json_response['writable_by'],
374 "Should receive uuid list in 'writable_by' field")
375 assert_includes(json_response['writable_by'], users(:active).uuid,
376 "owner should be included in writable_by list")
379 test 'no writable_by list for group with read-only access' do
380 authorize_with :rominiadmin
382 id: groups(:testusergroup_admins).uuid,
385 assert_response :success
386 assert_equal([json_response['owner_uuid']],
387 json_response['writable_by'],
388 "Should only see owner_uuid in 'writable_by' field")
391 test 'get writable_by list by admin user' do
392 authorize_with :admin
394 id: groups(:testusergroup_admins).uuid,
397 assert_response :success
398 assert_not_nil(json_response['writable_by'],
399 "Should receive uuid list in 'writable_by' field")
400 assert_includes(json_response['writable_by'],
402 "Current user should be included in 'writable_by' field")
405 test 'creating subproject with duplicate name fails' do
406 authorize_with :active
407 post :create, params: {
410 owner_uuid: users(:active).uuid,
411 group_class: 'project',
415 response_errors = json_response['errors']
416 assert_not_nil response_errors, 'Expected error in response'
417 assert(response_errors.first.include?('duplicate key'),
418 "Expected 'duplicate key' error in #{response_errors.first}")
421 test 'creating duplicate named subproject succeeds with ensure_unique_name' do
422 authorize_with :active
423 post :create, params: {
426 owner_uuid: users(:active).uuid,
427 group_class: 'project',
429 ensure_unique_name: true
431 assert_response :success
432 new_project = json_response
433 assert_not_equal(new_project['uuid'],
434 groups(:aproject).uuid,
435 "create returned same uuid as existing project")
436 assert_match(/^A Project \(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z\)$/,
441 [['owner_uuid', '!=', 'zzzzz-tpzed-xurymjxw79nv3jz'], 200,
442 'zzzzz-d1hrv-subprojpipeline', 'zzzzz-d1hrv-1xfj6xkicf2muk2'],
443 [["pipeline_instances.state", "not in", ["Complete", "Failed"]], 200,
444 'zzzzz-d1hrv-1xfj6xkicf2muk2', 'zzzzz-d1hrv-i3e77t9z5y8j9cc'],
445 [['container_requests.requesting_container_uuid', '=', nil], 200,
446 'zzzzz-xvhdp-cr4queuedcontnr', 'zzzzz-xvhdp-cr4requestercn2'],
447 [['container_requests.no_such_column', '=', nil], 422],
448 [['container_requests.', '=', nil], 422],
449 [['.requesting_container_uuid', '=', nil], 422],
450 [['no_such_table.uuid', '!=', 'zzzzz-tpzed-xurymjxw79nv3jz'], 422],
451 ].each do |filter, expect_code, expect_uuid, not_expect_uuid|
452 test "get contents with '#{filter}' filter" do
453 authorize_with :active
454 get :contents, params: {filters: [filter], format: :json}
455 assert_response expect_code
456 if expect_code == 200
457 assert_not_empty json_response['items']
458 item_uuids = json_response['items'].collect {|item| item['uuid']}
459 assert_includes(item_uuids, expect_uuid)
460 assert_not_includes(item_uuids, not_expect_uuid)
465 test 'get contents with jobs and pipeline instances disabled' do
466 Rails.configuration.API.DisabledAPIs = ConfigLoader.to_OrderedOptions(
467 {'jobs.index'=>{}, 'pipeline_instances.index'=>{}})
469 authorize_with :active
470 get :contents, params: {
471 id: groups(:aproject).uuid,
474 check_project_contents_response %w'arvados#pipelineInstance arvados#job'
477 test 'get contents with low max_index_database_read' do
478 # Some result will certainly have at least 12 bytes in a
480 Rails.configuration.API.MaxIndexDatabaseRead = 12
481 authorize_with :active
482 get :contents, params: {
483 id: groups(:aproject).uuid,
486 assert_response :success
487 assert_not_empty(json_response['items'])
488 assert_operator(json_response['items'].count,
489 :<, json_response['items_available'])
492 test 'get contents, recursive=true' do
493 authorize_with :active
495 id: groups(:aproject).uuid,
499 get :contents, params: params
500 owners = json_response['items'].map do |item|
503 assert_includes(owners, groups(:aproject).uuid)
504 assert_includes(owners, groups(:asubproject).uuid)
507 [false, nil].each do |recursive|
508 test "get contents, recursive=#{recursive.inspect}" do
509 authorize_with :active
511 id: groups(:aproject).uuid,
514 params[:recursive] = false if recursive == false
515 get :contents, params: params
516 owners = json_response['items'].map do |item|
519 assert_includes(owners, groups(:aproject).uuid)
520 refute_includes(owners, groups(:asubproject).uuid)
524 test 'get home project contents, recursive=true' do
525 authorize_with :active
526 get :contents, params: {
527 id: users(:active).uuid,
531 owners = json_response['items'].map do |item|
534 assert_includes(owners, users(:active).uuid)
535 assert_includes(owners, groups(:aproject).uuid)
536 assert_includes(owners, groups(:asubproject).uuid)
539 ### trashed project tests ###
544 # trashed_project (zzzzz-j7d0g-trashedproject1)
545 # trashed_subproject (zzzzz-j7d0g-trashedproject2)
546 # trashed_subproject3 (zzzzz-j7d0g-trashedproject3)
547 # zzzzz-xvhdp-cr5trashedcontr
550 :admin].each do |auth|
551 # project: to query, to untrash, is visible, parent contents listing success
553 [:trashed_project, [], false, true],
554 [:trashed_project, [:trashed_project], true, true],
555 [:trashed_subproject, [], false, false],
556 [:trashed_subproject, [:trashed_project], true, true],
557 [:trashed_subproject3, [:trashed_project], false, true],
558 [:trashed_subproject3, [:trashed_subproject3], false, false],
559 [:trashed_subproject3, [:trashed_project, :trashed_subproject3], true, true],
560 ].each do |project, untrash, visible, success|
562 test "contents listing #{project} #{untrash} as #{auth}" do
565 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
567 get :contents, params: {
568 id: groups(project).owner_uuid,
572 assert_response :success
573 item_uuids = json_response['items'].map do |item|
577 assert_includes(item_uuids, groups(project).uuid)
579 assert_not_includes(item_uuids, groups(project).uuid)
586 test "contents of #{project} #{untrash} as #{auth}" do
589 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
591 get :contents, params: {
592 id: groups(project).uuid,
596 assert_response :success
602 test "index #{project} #{untrash} as #{auth}" do
605 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
607 get :index, params: {
610 assert_response :success
611 item_uuids = json_response['items'].map do |item|
615 assert_includes(item_uuids, groups(project).uuid)
617 assert_not_includes(item_uuids, groups(project).uuid)
621 test "show #{project} #{untrash} as #{auth}" do
624 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
627 id: groups(project).uuid,
631 assert_response :success
637 test "show include_trash=false #{project} #{untrash} as #{auth}" do
640 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
643 id: groups(project).uuid,
648 assert_response :success
654 test "show include_trash #{project} #{untrash} as #{auth}" do
657 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
660 id: groups(project).uuid,
664 assert_response :success
667 test "index include_trash #{project} #{untrash} as #{auth}" do
670 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
672 get :index, params: {
676 assert_response :success
677 item_uuids = json_response['items'].map do |item|
680 assert_includes(item_uuids, groups(project).uuid)
684 test "delete project #{auth}" do
686 [:trashed_project].each do |pr|
687 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
689 assert !Group.find_by_uuid(groups(:trashed_project).uuid).is_trashed
690 post :destroy, params: {
691 id: groups(:trashed_project).uuid,
694 assert_response :success
695 assert Group.find_by_uuid(groups(:trashed_project).uuid).is_trashed
698 test "untrash project #{auth}" do
700 assert Group.find_by_uuid(groups(:trashed_project).uuid).is_trashed
701 post :untrash, params: {
702 id: groups(:trashed_project).uuid,
705 assert_response :success
706 assert !Group.find_by_uuid(groups(:trashed_project).uuid).is_trashed
709 test "untrash project with name conflict #{auth}" do
711 [:trashed_project].each do |pr|
712 Group.find_by_uuid(groups(pr).uuid).update! is_trashed: false
714 gc = Group.create!({owner_uuid: "zzzzz-j7d0g-trashedproject1",
715 name: "trashed subproject 3",
716 group_class: "project"})
717 post :untrash, params: {
718 id: groups(:trashed_subproject3).uuid,
720 ensure_unique_name: true
722 assert_response :success
723 assert_match /^trashed subproject 3 \(\d{4}-\d\d-\d\d.*?Z\)$/, json_response['name']
726 test "move trashed subproject to new owner #{auth}" do
728 assert_nil Group.readable_by(users(auth)).where(uuid: groups(:trashed_subproject).uuid).first
729 put :update, params: {
730 id: groups(:trashed_subproject).uuid,
732 owner_uuid: users(:active).uuid
737 assert_response :success
738 assert_not_nil Group.readable_by(users(auth)).where(uuid: groups(:trashed_subproject).uuid).first
742 test 'get shared owned by another user' do
743 authorize_with :user_bar_in_sharing_group
745 act_as_system_user do
747 tail_uuid: users(:user_bar_in_sharing_group).uuid,
748 link_class: 'permission',
750 head_uuid: groups(:project_owned_by_foo).uuid)
753 get :shared, params: {:filters => [["group_class", "=", "project"]], :include => "owner_uuid"}
755 assert_equal 1, json_response['items'].length
756 assert_equal json_response['items'][0]["uuid"], groups(:project_owned_by_foo).uuid
758 assert_equal 1, json_response['included'].length
759 assert_equal json_response['included'][0]["uuid"], users(:user_foo_in_sharing_group).uuid
762 test 'get shared, owned by unreadable project' do
763 authorize_with :user_bar_in_sharing_group
765 act_as_system_user do
766 Group.find_by_uuid(groups(:project_owned_by_foo).uuid).update!(owner_uuid: groups(:aproject).uuid)
768 tail_uuid: users(:user_bar_in_sharing_group).uuid,
769 link_class: 'permission',
771 head_uuid: groups(:project_owned_by_foo).uuid)
774 get :shared, params: {:filters => [["group_class", "=", "project"]], :include => "owner_uuid"}
776 assert_equal 1, json_response['items'].length
777 assert_equal json_response['items'][0]["uuid"], groups(:project_owned_by_foo).uuid
779 assert_equal 0, json_response['included'].length
782 test 'get shared, add permission link' do
783 authorize_with :user_bar_in_sharing_group
785 act_as_system_user do
786 Link.create!(tail_uuid: groups(:group_for_sharing_tests).uuid,
787 head_uuid: groups(:project_owned_by_foo).uuid,
788 link_class: 'permission',
792 get :shared, params: {:filters => [["group_class", "=", "project"]], :include => "owner_uuid"}
794 assert_equal 1, json_response['items'].length
795 assert_equal groups(:project_owned_by_foo).uuid, json_response['items'][0]["uuid"]
797 assert_equal 1, json_response['included'].length
798 assert_equal users(:user_foo_in_sharing_group).uuid, json_response['included'][0]["uuid"]
801 ### contents with exclude_home_project
803 test 'contents, exclude home owned by another user' do
804 authorize_with :user_bar_in_sharing_group
806 act_as_system_user do
808 tail_uuid: users(:user_bar_in_sharing_group).uuid,
809 link_class: 'permission',
811 head_uuid: groups(:project_owned_by_foo).uuid)
813 tail_uuid: users(:user_bar_in_sharing_group).uuid,
814 link_class: 'permission',
816 head_uuid: collections(:collection_owned_by_foo).uuid)
819 get :contents, params: {:include => "owner_uuid", :exclude_home_project => true}
821 assert_equal 2, json_response['items'].length
822 assert_equal json_response['items'][0]["uuid"], groups(:project_owned_by_foo).uuid
823 assert_equal json_response['items'][1]["uuid"], collections(:collection_owned_by_foo).uuid
825 assert_equal 1, json_response['included'].length
826 assert_equal json_response['included'][0]["uuid"], users(:user_foo_in_sharing_group).uuid
829 test 'contents, exclude home, owned by unreadable project' do
830 authorize_with :user_bar_in_sharing_group
832 act_as_system_user do
833 Group.find_by_uuid(groups(:project_owned_by_foo).uuid).update!(owner_uuid: groups(:aproject).uuid)
835 tail_uuid: users(:user_bar_in_sharing_group).uuid,
836 link_class: 'permission',
838 head_uuid: groups(:project_owned_by_foo).uuid)
841 get :contents, params: {:include => "owner_uuid", :exclude_home_project => true}
843 assert_equal 1, json_response['items'].length
844 assert_equal json_response['items'][0]["uuid"], groups(:project_owned_by_foo).uuid
846 assert_equal 0, json_response['included'].length
849 test 'contents, exclude home, add permission link' do
850 authorize_with :user_bar_in_sharing_group
852 act_as_system_user do
853 Link.create!(tail_uuid: groups(:group_for_sharing_tests).uuid,
854 head_uuid: groups(:project_owned_by_foo).uuid,
855 link_class: 'permission',
859 get :contents, params: {:include => "owner_uuid", :exclude_home_project => true}
861 assert_equal 1, json_response['items'].length
862 assert_equal groups(:project_owned_by_foo).uuid, json_response['items'][0]["uuid"]
864 assert_equal 1, json_response['included'].length
865 assert_equal users(:user_foo_in_sharing_group).uuid, json_response['included'][0]["uuid"]
868 test 'contents, exclude home, with parent specified' do
869 authorize_with :active
871 get :contents, params: {id: groups(:aproject).uuid, :include => "owner_uuid", :exclude_home_project => true}