Merge pull request #1156 from okriuchykhin/ok_SCI_2342

Enable editing office online files in inventories [SCI-2342]
This commit is contained in:
okriuchykhin 2018-05-23 12:59:12 +02:00 committed by GitHub
commit 7b08529e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -64,7 +64,7 @@ class AssetsController < ApplicationController
'preview-icon' => render_to_string( 'preview-icon' => render_to_string(
partial: 'shared/file_preview_icon.html.erb', partial: 'shared/file_preview_icon.html.erb',
locals: { asset: @asset } locals: { asset: @asset }
) )
) )
end end
@ -76,7 +76,7 @@ class AssetsController < ApplicationController
elsif @assoc.class == Result elsif @assoc.class == Result
can_manage_module?(@my_module) can_manage_module?(@my_module)
elsif @assoc.class == RepositoryCell elsif @assoc.class == RepositoryCell
# TBD can_manage_repository_rows?(@repository.team)
end end
response_json['wopi-controls'] = render_to_string( response_json['wopi-controls'] = render_to_string(
partial: 'shared/file_wopi_controlls.html.erb', partial: 'shared/file_wopi_controlls.html.erb',
@ -141,8 +141,8 @@ class AssetsController < ApplicationController
@protocol = @asset.step.protocol @protocol = @asset.step.protocol
elsif @assoc.class == Result elsif @assoc.class == Result
@my_module = @assoc.my_module @my_module = @assoc.my_module
else elsif @assoc.class == RepositoryCell
# TBD @repository = @assoc.repository_column.repository
end end
end end
@ -153,7 +153,7 @@ class AssetsController < ApplicationController
elsif @assoc.class == Result elsif @assoc.class == Result
render_403 and return unless can_read_experiment?(@my_module.experiment) render_403 and return unless can_read_experiment?(@my_module.experiment)
elsif @assoc.class == RepositoryCell elsif @assoc.class == RepositoryCell
# TBD render_403 and return unless can_read_team?(@repository.team)
end end
end end
@ -164,7 +164,7 @@ class AssetsController < ApplicationController
elsif @assoc.class == Result elsif @assoc.class == Result
render_403 and return unless can_manage_module?(@my_module) render_403 and return unless can_manage_module?(@my_module)
elsif @assoc.class == RepositoryCell elsif @assoc.class == RepositoryCell
# TBD render_403 and return unless can_manage_repository_rows?(@repository.team)
end end
end end

View file

@ -93,7 +93,7 @@ module WopiUtil
end end
activity.save activity.save
else elsif @assoc.class == Result
Activity.create( Activity.create(
type_of: :start_edit_wopi_file, type_of: :start_edit_wopi_file,
user: current_user, user: current_user,