16833: Merge branch 'master' into 16833-replace-epydoc
[arvados.git] / services / api / lib / current_api_client.rb
index 98112c858b98445c9bacb8c9c614343f8a7f5ef1..cfdae0bddec58455daf0d791b7a7731dd98e6e8b 100644 (file)
@@ -189,6 +189,16 @@ module CurrentApiClient
     end
   end
 
+  def system_root_token_api_client
+    $system_root_token_api_client = check_cache $system_root_token_api_client do
+      act_as_system_user do
+        ActiveRecord::Base.transaction do
+          ApiClient.find_or_create_by!(is_trusted: true, url_prefix: "", name: "SystemRootToken")
+        end
+      end
+    end
+  end
+
   def empty_collection_pdh
     'd41d8cd98f00b204e9800998ecf8427e+0'
   end