summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/views/roles/_form.html.erb5
-rw-r--r--test/functional/roles_controller_test.rb2
2 files changed, 5 insertions, 2 deletions
diff --git a/app/views/roles/_form.html.erb b/app/views/roles/_form.html.erb
index 4a49d53de..e149b0011 100644
--- a/app/views/roles/_form.html.erb
+++ b/app/views/roles/_form.html.erb
@@ -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">
diff --git a/test/functional/roles_controller_test.rb b/test/functional/roles_controller_test.rb
index e78370a46..dccb37fc7 100644
--- a/test/functional/roles_controller_test.rb
+++ b/test/functional/roles_controller_test.rb
@@ -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