4233: refactor to separate addDatum function
[arvados.git] / apps / workbench / app / controllers / collections_controller.rb
index 23a6896aca5d0589e296b6d3f2eee11876c84cc1..39f637e2274d5ac12037363c8051fd17b63d5d9e 100644 (file)
@@ -1,3 +1,5 @@
+require "arvados/keep"
+
 class CollectionsController < ApplicationController
   include ActionController::Live
 
@@ -269,7 +271,9 @@ class CollectionsController < ApplicationController
     most_specific_error = [401]
     token_list.each do |api_token|
       begin
-        using_specific_api_token(api_token) do
+        # We can't load the corresponding user, because the token may not
+        # be scoped for that.
+        using_specific_api_token(api_token, load_user: false) do
           yield
           return api_token
         end