Merge pull request #8002 from artoscinote/ma_SCI_11041

Enable file editing for inventory files [SCI-11041]
This commit is contained in:
Martin Artnik 2024-10-29 10:22:30 +01:00 committed by GitHub
commit 2af9ab7f5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,12 +22,11 @@ class AssetsController < ApplicationController
before_action :check_restore_permission, only: :restore_version
def file_preview
editable = can_manage_asset?(@asset) && @asset.repository_asset_value.blank?
render json: { html: render_to_string(
partial: 'shared/file_preview/content',
locals: {
asset: @asset,
can_edit: editable,
can_edit: can_manage_asset?(@asset),
gallery: params[:gallery],
preview: params[:preview]
},