add authorization checks

This commit is contained in:
Pete Matsyburka
2026-05-15 18:55:03 +03:00
parent 755decca27
commit e52830c9b4
7 changed files with 14 additions and 0 deletions
@@ -10,6 +10,8 @@ class TemplateDocumentsController < ApplicationController
end
def create
authorize!(:update, @template)
if params[:blobs].blank? && params[:files].blank?
return render json: { error: I18n.t('file_is_missing') }, status: :unprocessable_content
end