Made a note about user how permissions are applied when attempting to create a
authorPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 12 Jun 2014 15:14:03 +0000 (11:14 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Thu, 12 Jun 2014 15:14:03 +0000 (11:14 -0400)
token for another user.  Test for this case already exists.  closes #2350.

services/api/app/controllers/arvados/v1/api_client_authorizations_controller.rb

index 4a2bafde04eda0dc6c3639d963796a1d95734c8a..76a228d9d580c21d3483e9a01643255d67c012c4 100644 (file)
@@ -21,6 +21,12 @@ class Arvados::V1::ApiClientAuthorizationsController < ApplicationController
   end
 
   def create
+    # Note: the user could specify a owner_uuid for a different user, which on
+    # the surface appears to be a security hole.  However, the record will be
+    # rejected before being saved to the database by the ApiClientAuthorization
+    # model which enforces that user_id == current user or the user is an
+    # admin.
+
     if resource_attrs[:owner_uuid]
       # The model has an owner_id attribute instead of owner_uuid, but
       # we can't expect the client to know the local numeric ID. We