mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-05 16:43:25 +00:00
Permission check of the setting button on the issues page mismatches button semantics (#35090).
Patch by Takenori TAKAKI. git-svn-id: http://svn.redmine.org/redmine/trunk@21357 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
a68a187540
commit
873580ca74
@ -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>
|
||||
|
||||
|
||||
@ -2005,6 +2005,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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user