[ARVADOS] updated: 0e4624a002af66d14fb9f60111543932416dae58
Git user
git at public.curoverse.com
Thu Jun 8 14:44:26 EDT 2017
Summary of changes:
services/api/app/controllers/arvados/v1/collections_controller.rb | 2 +-
services/api/app/models/arvados_model.rb | 2 +-
services/api/test/functional/arvados/v1/collections_controller_test.rb | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
via 0e4624a002af66d14fb9f60111543932416dae58 (commit)
from 51a9aa4e9072ffec919187b3ed51bf624c0ba291 (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 0e4624a002af66d14fb9f60111543932416dae58
Author: Tom Clegg <tom at curoverse.com>
Date: Thu Jun 8 14:21:21 2017 -0400
11837: Fix "include_trash" scope and test case.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>
diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb
index 73a7e09..e3c10b7 100644
--- a/services/api/app/controllers/arvados/v1/collections_controller.rb
+++ b/services/api/app/controllers/arvados/v1/collections_controller.rb
@@ -13,7 +13,7 @@ class Arvados::V1::CollectionsController < ApplicationController
def find_objects_for_index
if params[:include_trash] || ['destroy', 'trash', 'untrash'].include?(action_name)
- @objects = Collection.readable_by(*@read_users).unscoped
+ @objects = Collection.unscoped.readable_by(*@read_users)
end
super
end
diff --git a/services/api/app/models/arvados_model.rb b/services/api/app/models/arvados_model.rb
index bb33c55..007d9e0 100644
--- a/services/api/app/models/arvados_model.rb
+++ b/services/api/app/models/arvados_model.rb
@@ -250,7 +250,7 @@ class ArvadosModel < ActiveRecord::Base
# Check if any of the users are admin. If so, we're done.
if users_list.select { |u| u.is_admin }.any?
- return self
+ return where('1=1')
end
# Collect the UUIDs of the authorized users.
diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index 055af9e..17af916 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -1045,7 +1045,7 @@ EOS
[:active, :admin].each do |user|
test "get trashed collections as #{user}" do
- authorize_with :active
+ authorize_with user
get :index, {
filters: [["is_trashed", "=", true]],
include_trash: true,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list