]> source.dussan.org Git - redmine.git/commitdiff
Merged r21357 from trunk to 4.1-stable (#35090).
authorGo MAEDA <maeda@farend.jp>
Wed, 12 Jan 2022 14:19:33 +0000 (14:19 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 12 Jan 2022 14:19:33 +0000 (14:19 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@21361 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/index.html.erb
test/functional/issues_controller_test.rb

index 880c953eaa2cfeba4e31e4f23b1d70338836cba8..b05b6ccf2dd53c0cf38579c087be1fb2fd90626a 100644 (file)
@@ -13,7 +13,7 @@
 
     <%= link_to_if_authorized l(:label_settings),
               {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'issues'},
-              :class => 'icon icon-settings' if User.current.allowed_to?(:manage_categories, @project) %>
+              :class => 'icon icon-settings' if User.current.allowed_to?(:edit_project, @project) %>
   <% end %>
 </div>
 
index 42c3b53c4832ad480f90f32a5c4b91a2d277a14b..9c62e135d44046c082fcb15179253676fa268501 100644 (file)
@@ -1707,6 +1707,22 @@ class IssuesControllerTest < Redmine::ControllerTest
     assert_select '#content a.new-issue[href="/issues/new"]', :text => 'New issue'
   end
 
+  def test_index_should_show_setting_link_with_edit_project_permission
+    role = Role.find(1)
+    role.add_permission! :edit_project
+    @request.session[:user_id] = 2
+    get(:index, :params => {:project_id => 1})
+    assert_select '#content a.icon-settings[href="/projects/ecookbook/settings/issues"]', 1
+  end
+
+  def test_index_should_not_show_setting_link_without_edit_project_permission
+    role = Role.find(1)
+    role.remove_permission! :edit_project
+    @request.session[:user_id] = 2
+    get(:index, :params => {:project_id => 1})
+    assert_select '#content a.icon-settings[href="/projects/ecookbook/settings/issues"]', 0
+  end
+
   def test_index_should_not_include_new_issue_tab_when_disabled
     with_settings :new_item_menu_tab => '0' do
       @request.session[:user_id] = 2