Merge branch 'master' into 2257-inequality-conditions
[arvados.git] / services / api / app / controllers / arvados / v1 / api_client_authorizations_controller.rb
index 65a3e00c415495fed61ab3928872ff90cc5a2d66..8fd915ddfbf48d8b3a336d47e58257147f3c6899 100644 (file)
@@ -2,6 +2,7 @@ class Arvados::V1::ApiClientAuthorizationsController < ApplicationController
   accept_attribute_as_json :scopes, Array
   before_filter :current_api_client_is_trusted
   before_filter :admin_required, :only => :create_system_auth
+  skip_before_filter :render_404_if_no_object, :only => :create_system_auth
 
   def self._create_system_auth_requires_parameters
     {
@@ -27,6 +28,7 @@ class Arvados::V1::ApiClientAuthorizationsController < ApplicationController
       resource_attrs[:user_id] =
         User.where(uuid: resource_attrs.delete(:owner_uuid)).first.andand.id
     end
+    resource_attrs[:api_client_id] = Thread.current[:api_client].id
     super
   end