20470: Handle nil selection, selecting on writable_by
authorPeter Amstutz <peter.amstutz@curii.com>
Wed, 3 May 2023 02:09:46 +0000 (22:09 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Wed, 3 May 2023 02:09:46 +0000 (22:09 -0400)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

services/api/app/controllers/application_controller.rb
services/api/app/models/group.rb

index ffe55b3c67e3a378adbc160c6125001dbafa7bda..1fbd65fd828841fa4e5806949ef9aac0c4445dee 100644 (file)
@@ -229,6 +229,7 @@ class ApplicationController < ActionController::Base
   end
 
   def select_for_klass sel, model_class
+    return nil if sel.nil?
     # Filter the select fields to only the ones that apply to the
     # given class.
     sel.map do |column|
index 85855fda97271a2cbfc855fef5d0862fa2a7122e..aa3a19bf87004f950e7e5f390650ce9ac964619f 100644 (file)
@@ -54,6 +54,7 @@ class Group < ArvadosModel
     super.merge(
                 'can_write' => ['owner_uuid', 'uuid'],
                 'can_manage' => ['owner_uuid', 'uuid'],
+                'writable_by' => ['owner_uuid', 'uuid'],
                 )
   end