Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curoverse.com>
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
# 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 existing relation with no new filters.
+ return where({})
end
# Collect the UUIDs of the authorized users.
[: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,