16750: Avoids using params on requests to make it compatible with federation.
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Thu, 1 Oct 2020 13:52:23 +0000 (10:52 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Fri, 2 Oct 2020 21:51:59 +0000 (18:51 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

apps/workbench/app/controllers/trash_items_controller.rb
apps/workbench/app/models/user.rb

index 12ef20aa664a337998c1fc5980cea350ece1e982..d8f7ae62c8591e6a218c659c64de861aafa05456 100644 (file)
@@ -95,12 +95,12 @@ class TrashItemsController < ApplicationController
         owner_uuids = @objects.collect(&:owner_uuid).uniq
         @owners = {}
         @not_trashed = {}
-        Group.filter([["uuid", "in", owner_uuids]]).with_count("none").include_trash(true).each do |grp|
-          @owners[grp.uuid] = grp
-        end
-        User.filter([["uuid", "in", owner_uuids]]).with_count("none").include_trash(true).each do |grp|
-          @owners[grp.uuid] = grp
-          @not_trashed[grp.uuid] = true
+        [Group, User].each do |owner_class|
+          owner_class.filter([["uuid", "in", owner_uuids]]).with_count("none")
+            .include_trash(true).fetch_multiple_pages(false)
+            .each do |owner|
+            @owners[owner.uuid] = owner
+          end
         end
         Group.filter([["uuid", "in", owner_uuids]]).with_count("none").select([:uuid]).each do |grp|
           @not_trashed[grp.uuid] = true
index 34e8181515c887fbe9e09659d09ebee4ab40f24f..c4b273c6b81e81cbcccd0034ee1aff1bf5a07424 100644 (file)
@@ -110,6 +110,6 @@ class User < ArvadosBase
   end
 
   def self.creatable?
-    current_user and current_user.is_admin
+    current_user.andand.is_admin
   end
 end