summaryrefslogtreecommitdiffstats
path: root/app/controllers/roles_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-07 20:27:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-04-07 20:27:19 +0000
commitbd9a44c2254ab785014207cb07f8b2fff1068b34 (patch)
tree4a105efe6e82a5e2fd1fa9ae4bac42b1a51f8fae /app/controllers/roles_controller.rb
parent30734ba8e8f040f3cff158351733c6228bd2db18 (diff)
downloadredmine-bd9a44c2254ab785014207cb07f8b2fff1068b34.tar.gz
redmine-bd9a44c2254ab785014207cb07f8b2fff1068b34.zip
Added permissions report (link available on roles list view).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@433 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/roles_controller.rb')
-rw-r--r--app/controllers/roles_controller.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb
index d0dd8eb47..0eba46d1e 100644
--- a/app/controllers/roles_controller.rb
+++ b/app/controllers/roles_controller.rb
@@ -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