diff options
author | Go MAEDA <maeda@farend.jp> | 2021-03-12 05:29:50 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-03-12 05:29:50 +0000 |
commit | cf7a401b89a1609376062eebefaf731b662c62c9 (patch) | |
tree | a4d9ae173ab039e3ae7b722d207aa9e227206492 /app/controllers/roles_controller.rb | |
parent | 9f73af6cb349433b2b73aa8faa769bc8a0c2dc6e (diff) | |
download | redmine-cf7a401b89a1609376062eebefaf731b662c62c9.tar.gz redmine-cf7a401b89a1609376062eebefaf731b662c62c9.zip |
Export permissions report to CSV (#13767).
Patch by David Escala and Yuichi HARADA.
git-svn-id: http://svn.redmine.org/redmine/trunk@20778 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/roles_controller.rb')
-rw-r--r-- | app/controllers/roles_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 27861d35d..870ea09ee 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -26,6 +26,8 @@ class RolesController < ApplicationController before_action :find_role, :only => [:show, :edit, :update, :destroy] accept_api_auth :index, :show + include RolesHelper + require_sudo_mode :create, :update, :destroy def index @@ -108,7 +110,13 @@ class RolesController < ApplicationController scope = scope.where(:id => params[:ids]) end @roles = scope.to_a - @permissions = Redmine::AccessControl.permissions.select {|p| !p.public?} + @permissions = Redmine::AccessControl.permissions.reject(&:public?) + respond_to do |format| + format.html + format.csv do + send_data(permissions_to_csv(@roles, @permissions), :type => 'text/csv; header=present', :filename => 'permissions.csv') + end + end end def update_permissions |