From 2e3bdf11795e0303d188668667cbb949066a390e Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 22 Oct 2014 16:05:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BB=8E=E6=B7=BB=E5=8A=A0=E3=80=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E3=80=81=E7=BC=BA=E9=99=B7=E5=8F=8A=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=B3=A8=E9=87=8A=E6=9D=83=E9=99=90=E4=B8=AD?= =?UTF-8?q?=E5=88=86=E7=A6=BB=E5=87=BA=E6=9D=A5=EF=BC=8C=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E6=9C=AA=E5=8A=A0=E5=85=A5=E4=BB=BB=E4=BD=95=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E3=80=81=E9=A1=B9=E7=9B=AE=E7=9A=84=E7=94=A8=E6=88=B7=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=E9=99=84=E4=BB=B6?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 2 +- config/locales/zh.yml | 1 + lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb | 2 +- lib/redmine.rb | 7 ++++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 0f1e03ee0..e7cf73511 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -499,7 +499,7 @@ en: permission_view_students: View students permission_export_homeworks: Export homeworks permission_notificationcomment_contestnotifications: Add the notice of contest comments - + permission_upload_attachments: Uploading resource project_module_issue_tracking: Issue tracking project_module_time_tracking: Time tracking diff --git a/config/locales/zh.yml b/config/locales/zh.yml index f453b21c3..d20bb6e6d 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -497,6 +497,7 @@ zh: permission_projects_attachments_download: 项目附件下载 permission_course_attachments_download: 课程附件下载 permission_contest_attachments_download: 竞赛附件下载 + permission_upload_attachments: 资源上传 project_module_issue_tracking: 问题跟踪 project_module_time_tracking: 时间跟踪 diff --git a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb index 85871a19c..bdd28079f 100644 --- a/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb +++ b/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb @@ -142,7 +142,7 @@ module Redmine elsif a && attachment['is_public_checkbox'] a.is_public = true end - set_attachment_public(a) + set_attachment_public(a) if a next unless a a.description = attachment['description'].to_s.strip a.attachtype = @curattachment_type; diff --git a/lib/redmine.rb b/lib/redmine.rb index 3ec7b114c..cd855e01a 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -99,6 +99,7 @@ Redmine::AccessControl.map do |map| map.permission :add_subprojects, {:projects => [:new, :create]}, :require => :member ,:belong_to_project => true #错的权限,先注释掉 #map.permission :view_journals_for_messages, {:gantts => [:show, :update]}, :read => true + map.permission :upload_attachments,{:attachments => :upload},:require => :loggedin map.permission :quote_project, {},:require => :member,:belong_to_contest => true map.permission :is_manager,{},:require => :member ,:belong_to_project => true @@ -159,13 +160,13 @@ Redmine::AccessControl.map do |map| :queries => :index, :reports => [:issue_report, :issue_report_details]}, :read => true - map.permission :add_issues, {:issues => [:new, :create, :update_form], :attachments => :upload} - map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :bulk_update, :update_form], :journals => [:new], :attachments => :upload} + map.permission :add_issues, {:issues => [:new, :create, :update_form]} + map.permission :edit_issues, {:issues => [:edit, :update, :bulk_edit, :bulk_update, :update_form], :journals => [:new]} map.permission :manage_issue_relations, {:issue_relations => [:index, :show, :create, :destroy]} map.permission :manage_subtasks, {} map.permission :set_issues_private, {} map.permission :set_own_issues_private, {}, :require => :loggedin - map.permission :add_issue_notes, {:issues => [:edit, :update, :update_form], :journals => [:new], :attachments => :upload} + map.permission :add_issue_notes, {:issues => [:edit, :update, :update_form], :journals => [:new]} map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin map.permission :view_private_notes, {}, :read => true, :require => :member