将上传资源权限从添加、编辑、缺陷及编辑缺陷注释权限中分离出来,修正未加入任何课程、项目的用户无法上传资源附件bug

This commit is contained in:
z9hang 2014-10-22 16:05:08 +08:00
parent 491020b6df
commit 2e3bdf1179
4 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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: 时间跟踪

View File

@ -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;

View File

@ -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