From: Peter Amstutz Date: Wed, 3 May 2023 02:09:46 +0000 (-0400) Subject: 20470: Handle nil selection, selecting on writable_by X-Git-Tag: 2.7.0~116^2~5 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/385d9ac5f47bec5c5a5fc9770c74b1a7d8dd2974?hp=f4e3341d2857114e8c3ea0a7941ff8429491dd59 20470: Handle nil selection, selecting on writable_by Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index ffe55b3c67..1fbd65fd82 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -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| diff --git a/services/api/app/models/group.rb b/services/api/app/models/group.rb index 85855fda97..aa3a19bf87 100644 --- a/services/api/app/models/group.rb +++ b/services/api/app/models/group.rb @@ -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