From 385d9ac5f47bec5c5a5fc9770c74b1a7d8dd2974 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 2 May 2023 22:09:46 -0400 Subject: [PATCH] 20470: Handle nil selection, selecting on writable_by Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- services/api/app/controllers/application_controller.rb | 1 + services/api/app/models/group.rb | 1 + 2 files changed, 2 insertions(+) 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 -- 2.30.2