From aef1cc3e8492f8e7f8ac0377978407519b85447f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Tue, 4 Dec 2018 11:01:25 +0100 Subject: [PATCH] Adding the file's ID into allowed_to's options --- lib/redmine_dmsf/macros.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redmine_dmsf/macros.rb b/lib/redmine_dmsf/macros.rb index 36f658b5..e93b43da 100644 --- a/lib/redmine_dmsf/macros.rb +++ b/lib/redmine_dmsf/macros.rb @@ -35,7 +35,7 @@ Redmine::WikiFormatting::Macros.register do raise ActiveRecord::RecordNotFound end end - if User.current && User.current.allowed_to?(:view_dmsf_files, file.project) + if User.current && User.current.allowed_to?(:view_dmsf_files, file.project, { id: file.id }) file_view_url = url_for(:controller => :dmsf_files, :action => 'view', :id => file, :download => args[2]) title = args[1] ? args[1] : file.title title.gsub!(/\A"|"\z/,'') # Remove apostrophes