mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 14:26:04 +01:00
Don't show unsettable permissions in the tracker permissions table (#30431).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@18508 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -47,7 +47,8 @@
|
||||
|
||||
<h3><%= l(:label_permissions) %></h3>
|
||||
<div class="box tabular" id="permissions">
|
||||
<% perms_by_module = @role.setable_permissions.group_by {|p| p.project_module.to_s} %>
|
||||
<% setable_permissions = @role.setable_permissions %>
|
||||
<% perms_by_module = setable_permissions.group_by {|p| p.project_module.to_s} %>
|
||||
<% perms_by_module.keys.sort.each do |mod| %>
|
||||
<% module_name = mod.blank? ? 'module_project' : "module_#{mod}" %>
|
||||
<fieldset id="<%= module_name %>"><legend><%= toggle_checkboxes_link("##{module_name}\ input") %><%= mod.blank? ? l(:label_project) : l_or_humanize(mod, :prefix => 'project_module_') %></legend>
|
||||
@@ -67,7 +68,7 @@
|
||||
|
||||
<div id="role-permissions-trackers" class="view_issues_shown">
|
||||
<h3><%= l(:label_issue_tracking) %></h3>
|
||||
<% permissions = %w(view_issues add_issues edit_issues add_issue_notes delete_issues) %>
|
||||
<% permissions = [:view_issues, :add_issues, :edit_issues, :add_issue_notes, :delete_issues] & setable_permissions.collect(&:name) %>
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list">
|
||||
|
||||
@@ -158,6 +158,7 @@ class RolesControllerTest < Redmine::ControllerTest
|
||||
|
||||
assert_select 'input[name=?][value=?]', 'role[name]', 'Manager'
|
||||
assert_select 'select[name=?]', 'role[issues_visibility]'
|
||||
assert_select '#role-permissions-trackers table .delete_issues_shown'
|
||||
end
|
||||
|
||||
def test_edit_anonymous
|
||||
@@ -166,6 +167,7 @@ class RolesControllerTest < Redmine::ControllerTest
|
||||
|
||||
assert_select 'input[name=?]', 'role[name]', 0
|
||||
assert_select 'select[name=?]', 'role[issues_visibility]', 0
|
||||
assert_select '#role-permissions-trackers table .delete_issues_shown', 0
|
||||
end
|
||||
|
||||
def test_edit_invalid_should_respond_with_404
|
||||
|
||||
Reference in New Issue
Block a user