filter workflow params

This commit is contained in:
ulferts
2025-03-01 21:27:22 +01:00
parent 6eac5926eb
commit 02c0481b3d
+7 -1
View File
@@ -57,7 +57,7 @@ class WorkflowsController < ApplicationController
def update
call = Workflows::BulkUpdateService
.new(role: @role, type: @type)
.call(params["status"])
.call(permitted_status_params)
if call.success?
flash[:notice] = I18n.t(:notice_successful_update)
@@ -148,4 +148,10 @@ class WorkflowsController < ApplicationController
roles
end
end
def permitted_status_params
params["status"]
.to_unsafe_h
.select { |key, value| /\A\d+\z/.match?(key) && /\A\d+\z/.match?(value) }
end
end