add cancan for authorization

This commit is contained in:
Alex Turchyn
2023-09-17 00:45:57 +03:00
parent f89c50d096
commit 2f1843151d
58 changed files with 343 additions and 186 deletions
@@ -2,11 +2,11 @@
module Api
class TemplatesDocumentsController < ApiBaseController
load_and_authorize_resource :template
def create
return head :unprocessable_entity if params[:blobs].blank? && params[:files].blank?
@template = current_account.templates.find(params[:template_id])
documents = Templates::CreateAttachments.call(@template, params)
schema = documents.map do |doc|