mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-10 01:21:32 +00:00
Menu should not include "New issue" for users with copy issues permission only.
git-svn-id: http://svn.redmine.org/redmine/trunk@14290 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
9e39ad4719
commit
78384d147a
@ -231,7 +231,8 @@ Redmine::MenuManager.map :project_menu do |menu|
|
||||
menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural
|
||||
menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
|
||||
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) },
|
||||
:if => Proc.new { |p| p.trackers.any? }
|
||||
:if => Proc.new { |p| p.trackers.any? },
|
||||
:permission => :add_issues
|
||||
menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt
|
||||
menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar
|
||||
menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
|
||||
|
||||
@ -671,4 +671,14 @@ class ProjectsControllerTest < ActionController::TestCase
|
||||
get :show, :id => 1
|
||||
assert_select '#main-menu a.new-issue', 0
|
||||
end
|
||||
|
||||
def test_project_menu_should_not_include_new_issue_link_for_users_with_copy_issues_permission_only
|
||||
role = Role.find(1)
|
||||
role.remove_permission! :add_issues
|
||||
role.add_permission! :copy_issues
|
||||
|
||||
@request.session[:user_id] = 2
|
||||
get :show, :id => 1
|
||||
assert_select '#main-menu a.new-issue', 0
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user