]> source.dussan.org Git - redmine.git/commitdiff
Added a rake task to display permissions.
authorEric Davis <edavis@littlestreamsoftware.com>
Wed, 18 Aug 2010 17:23:23 +0000 (17:23 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Wed, 18 Aug 2010 17:23:23 +0000 (17:23 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3948 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/tasks/permissions.rake [new file with mode: 0644]

diff --git a/lib/tasks/permissions.rake b/lib/tasks/permissions.rake
new file mode 100644 (file)
index 0000000..02ce1b2
--- /dev/null
@@ -0,0 +1,9 @@
+namespace :redmine do
+  desc "List all permissions and the actions registered with them"
+  task :permissions => :environment do
+    puts "Permission Name - controller/action pairs"
+    Redmine::AccessControl.permissions.sort {|a,b| a.name.to_s <=> b.name.to_s }.each do |permission|
+      puts ":#{permission.name} - #{permission.actions.join(', ')}"
+    end
+  end
+end