From 1e5721ce952aa1106f87770eedfecf91377ecd89 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Thu, 11 Apr 2019 17:21:07 +0200 Subject: [PATCH] Disable editing of office file in view mode when module is locked Closes SCI-2949 --- app/controllers/wopi_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/wopi_controller.rb b/app/controllers/wopi_controller.rb index cac3fb4d6..183403aef 100644 --- a/app/controllers/wopi_controller.rb +++ b/app/controllers/wopi_controller.rb @@ -325,7 +325,7 @@ class WopiController < ActionController::Base @breadcrumb_folder_url = @close_url elsif @assoc.class == RepositoryCell @can_read = can_read_team?(@team) - @can_write = can_manage_repository_rows?(@team) + @can_write = can_edit_wopi_file_in_repository_rows? @close_url = repository_url(@repository, only_path: false, @@ -364,4 +364,9 @@ class WopiController < ActionController::Base logger.warn 'WOPI: proof verification: failed; ' + e.message render body: nil, status: 500 and return end + + # Overwrriten in electronic signature for locked inventory items + def can_edit_wopi_file_in_repository_rows? + can_manage_repository_rows?(@team) + end end