diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index 9480f297..7cc92356 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -1,8 +1,10 @@ +# encoding: utf-8 +# # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš # Copyright (C) 2012 Daniel Munn -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -35,7 +37,8 @@ class DmsfController < ApplicationController def show @folder_manipulation_allowed = User.current.allowed_to?(:folder_manipulation, @project) @file_manipulation_allowed = User.current.allowed_to?(:file_manipulation, @project) - @file_delete_allowed = User.current.allowed_to?(:file_delete, @project) + @file_delete_allowed = User.current.allowed_to?(:file_delete, @project) + @file_view_allowed = User.current.allowed_to?(:view_dmsf_files, @project) @force_file_unlock_allowed = User.current.allowed_to?(:force_file_unlock, @project) @workflows_available = DmsfWorkflow.where(['project_id = ? OR project_id IS NULL', @project.id]).count > 0 @file_approval_allowed = User.current.allowed_to?(:file_approval, @project) diff --git a/app/views/dmsf/show.html.erb b/app/views/dmsf/show.html.erb index c984478a..491e0ff4 100644 --- a/app/views/dmsf/show.html.erb +++ b/app/views/dmsf/show.html.erb @@ -1,9 +1,11 @@ <%#= +# encoding: utf-8 +# # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš # Copyright (C) 2012 Daniel Munn -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -107,9 +109,9 @@ :class => 'dmfs_entries', :id => 'entries_form') do %> <%= hidden_field_tag('action') %>
- <%= submit_tag(l(:button_download), :title => l(:title_download_checked), :name => 'download_entries') %> - <%= submit_tag(l(:field_mail), :title => l(:title_send_checked_by_email), :name => 'email_entries') %> - <%= submit_tag(l(:button_delete), :title => l(:title_delete_checked), :name => 'delete_entries') %> + <%= submit_tag(l(:button_download), :title => l(:title_download_checked), :name => 'download_entries') if @file_view_allowed %> + <%= submit_tag(l(:field_mail), :title => l(:title_send_checked_by_email), :name => 'email_entries') if @file_view_allowed %> + <%= submit_tag(l(:button_delete), :title => l(:title_delete_checked), :name => 'delete_entries') if @file_delete_allowed %>
<% values = @folder ? @folder.custom_field_values : @parent ? @parent.custom_field_values : DmsfFolder.new(:project => @project).custom_field_values %> <% unless values.empty? %> diff --git a/init.rb b/init.rb index f3d76219..57c3fcbb 100644 --- a/init.rb +++ b/init.rb @@ -1,8 +1,10 @@ +# encoding: utf-8 +# # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš # Copyright (C) 2012 Daniel Munn -# Copyright (C) 2011-14 Karel Picman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -69,13 +71,15 @@ Redmine::Plugin.register :redmine_dmsf do :dmsf_workflows => [:log]}, :read => true permission :folder_manipulation, - {:dmsf => [:new, :create, :delete, :edit, :save, :edit_root, :save_root, :lock, :unlock, :notify_activate, :notify_deactivate, :delete_entries, :restore]} + {:dmsf => [:new, :create, :delete, :edit, :save, :edit_root, :save_root, :lock, :unlock, :notify_activate, :notify_deactivate, :restore]} permission :file_manipulation, {:dmsf_files => [:create_revision, :lock, :unlock, :delete_revision, :notify_activate, :notify_deactivate, :restore], :dmsf_upload => [:upload_files, :upload_file, :commit_files], :dmsf_links => [:new, :create, :destroy, :restore] } - permission :file_delete, { :dmsf => [:trash], :dmsf_files => [:delete]} + permission :file_delete, + { :dmsf => [:trash, :delete_entries], + :dmsf_files => [:delete]} permission :force_file_unlock, {} permission :file_approval, {:dmsf_workflows => [:action, :new_action, :autocomplete_for_user, :start, :assign, :assignment]}