@@ -231,7 +231,8 Redmine::MenuManager.map :project_menu do |menu| | |||
|
231 | 231 | menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural |
|
232 | 232 | menu.push :new_issue, { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new, |
|
233 | 233 | :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, |
|
234 | :if => Proc.new { |p| p.trackers.any? } | |
|
234 | :if => Proc.new { |p| p.trackers.any? }, | |
|
235 | :permission => :add_issues | |
|
235 | 236 | menu.push :gantt, { :controller => 'gantts', :action => 'show' }, :param => :project_id, :caption => :label_gantt |
|
236 | 237 | menu.push :calendar, { :controller => 'calendars', :action => 'show' }, :param => :project_id, :caption => :label_calendar |
|
237 | 238 | menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural |
@@ -671,4 +671,14 class ProjectsControllerTest < ActionController::TestCase | |||
|
671 | 671 | get :show, :id => 1 |
|
672 | 672 | assert_select '#main-menu a.new-issue', 0 |
|
673 | 673 | end |
|
674 | ||
|
675 | def test_project_menu_should_not_include_new_issue_link_for_users_with_copy_issues_permission_only | |
|
676 | role = Role.find(1) | |
|
677 | role.remove_permission! :add_issues | |
|
678 | role.add_permission! :copy_issues | |
|
679 | ||
|
680 | @request.session[:user_id] = 2 | |
|
681 | get :show, :id => 1 | |
|
682 | assert_select '#main-menu a.new-issue', 0 | |
|
683 | end | |
|
674 | 684 | end |
General Comments 0
You need to be logged in to leave comments.
Login now