mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 01:35:34 +08:00
Merge pull request #4336 from okriuchykhin/ok_SCI_7073
Fix result with WOPI file creation [SCI-7073]
This commit is contained in:
commit
b91d9e3a28
2 changed files with 4 additions and 6 deletions
|
@ -22,7 +22,7 @@ Canaid::Permissions.register_for(Asset) do
|
|||
when Step
|
||||
can_manage_step?(user, object)
|
||||
when Result
|
||||
can_manage_result?(object)
|
||||
can_manage_result?(user, object)
|
||||
when RepositoryCell
|
||||
if object.repository_column.repository.is_a?(RepositorySnapshot)
|
||||
false
|
||||
|
|
|
@ -104,7 +104,6 @@ class AssetSerializer < ActiveModel::Serializer
|
|||
end
|
||||
|
||||
def urls
|
||||
@user = scope[:user] || @instance_options[:user]
|
||||
urls = {
|
||||
preview: asset_file_preview_path(object),
|
||||
download: rails_blob_path(object.file, disposition: 'attachment'),
|
||||
|
@ -113,7 +112,8 @@ class AssetSerializer < ActiveModel::Serializer
|
|||
marvin_js: marvin_js_asset_path(object),
|
||||
marvin_js_icon: image_path('icon_small/marvinjs.svg')
|
||||
}
|
||||
if can_manage_asset?(@user, object)
|
||||
user = scope[:user] || @instance_options[:user]
|
||||
if can_manage_asset?(user, object)
|
||||
urls.merge!(
|
||||
toggle_view_mode: toggle_view_mode_path(object),
|
||||
edit_asset: edit_asset_path(object),
|
||||
|
@ -122,9 +122,7 @@ class AssetSerializer < ActiveModel::Serializer
|
|||
delete: asset_destroy_path(object)
|
||||
)
|
||||
end
|
||||
if wopi && can_manage_asset?(@user, object)
|
||||
urls[:wopi_action] = object.get_action_url(@user, 'embedview')
|
||||
end
|
||||
urls[:wopi_action] = object.get_action_url(user, 'embedview') if wopi && can_manage_asset?(user, object)
|
||||
urls[:blob] = rails_blob_path(object.file, disposition: 'attachment') if object.file.attached?
|
||||
|
||||
urls
|
||||
|
|
Loading…
Reference in a new issue