Added permissions report (link available on roles list view).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@433 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
30734ba8e8
commit
bd9a44c225
|
@ -99,4 +99,17 @@ class RolesController < ApplicationController
|
|||
@trackers = Tracker.find(:all, :order => 'position')
|
||||
@statuses = IssueStatus.find(:all, :include => :workflows, :order => 'position')
|
||||
end
|
||||
|
||||
def report
|
||||
@roles = Role.find :all
|
||||
@permissions = Permission.find :all, :conditions => ["is_public=?", false], :order => 'sort'
|
||||
if request.post?
|
||||
@roles.each do |role|
|
||||
role.permissions = Permission.find(params[:permission_ids] ? (params[:permission_ids][role.id.to_s] || []) : [] )
|
||||
end
|
||||
Permission.allowed_to_role_expired
|
||||
flash[:notice] = l(:notice_successful_update)
|
||||
redirect_to :action => 'list'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,4 +27,6 @@
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= pagination_links_full @role_pages %>
|
||||
<p><%= pagination_links_full @role_pages %></p>
|
||||
|
||||
<p><%= link_to l(:label_permissions_report), :action => 'report' %></p>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
<h2><%=l(:label_permissions_report)%></h2>
|
||||
|
||||
<%= start_form_tag({:action => 'report'}, :id => 'permissions_form') %>
|
||||
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th><%=l(:label_permissions)%></th>
|
||||
<th colspan="<%= @roles.length %>"><%= l(:label_role_plural) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% permissions = @permissions.group_by {|p| p.group_id } %>
|
||||
<% permissions.keys.sort.each do |group_id| %>
|
||||
<tr>
|
||||
<th><%= l(Permission::GROUPS[group_id]) %></th>
|
||||
<% @roles.each do |role| %><th align="center"><small><%= role.name %></small></th><% end %>
|
||||
</tr>
|
||||
<% permissions[group_id].each do |p| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td><%= l(p.description.to_sym) %></td>
|
||||
<% @roles.each do |role| %>
|
||||
<td align="center"><%= check_box_tag "permission_ids[#{role.id}][]", p.id, (role.permissions.include? p) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% reset_cycle
|
||||
end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><%= check_all_links 'permissions_form' %></p>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
<%= end_form_tag %>
|
|
@ -355,6 +355,7 @@ label_diff_inline: inline
|
|||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
label_permissions_report: Permissions report
|
||||
|
||||
button_login: Einloggen
|
||||
button_submit: OK
|
||||
|
|
|
@ -355,6 +355,7 @@ label_diff_inline: inline
|
|||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
label_permissions_report: Permissions report
|
||||
|
||||
button_login: Login
|
||||
button_submit: Submit
|
||||
|
|
|
@ -355,6 +355,7 @@ label_diff_inline: inline
|
|||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
label_permissions_report: Permissions report
|
||||
|
||||
button_login: Conexión
|
||||
button_submit: Someter
|
||||
|
|
|
@ -355,6 +355,7 @@ label_diff_inline: en ligne
|
|||
label_diff_side_by_side: côte à côte
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copier le workflow de
|
||||
label_permissions_report: Synthèse des permissions
|
||||
|
||||
button_login: Connexion
|
||||
button_submit: Soumettre
|
||||
|
|
|
@ -355,6 +355,7 @@ label_diff_inline: inline
|
|||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
label_permissions_report: Permissions report
|
||||
|
||||
button_login: Login
|
||||
button_submit: Invia
|
||||
|
|
|
@ -356,6 +356,7 @@ label_diff_inline: インライン
|
|||
label_diff_side_by_side: 横に並べる
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
label_permissions_report: Permissions report
|
||||
|
||||
button_login: ログイン
|
||||
button_submit: 変更
|
||||
|
|
|
@ -358,6 +358,7 @@ label_diff_inline: inline
|
|||
label_diff_side_by_side: side by side
|
||||
label_options: Options
|
||||
label_copy_workflow_from: Copy workflow from
|
||||
label_permissions_report: Permissions report
|
||||
|
||||
button_login: 登录
|
||||
button_submit: 提交
|
||||
|
|
|
@ -302,9 +302,10 @@ table.list thead th {
|
|||
}
|
||||
|
||||
table.list tbody th {
|
||||
font-weight: normal;
|
||||
font-weight: bold;
|
||||
background: #eed;
|
||||
border: 1px solid #d7d7d7;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
/********** Validation error messages *************/
|
||||
|
|
Loading…
Reference in New Issue