]> source.dussan.org Git - redmine.git/commitdiff
Add User#allowed_to_globally? which wraps User#allowed_to?
authorEric Davis <edavis@littlestreamsoftware.com>
Mon, 20 Sep 2010 16:38:00 +0000 (16:38 +0000)
committerEric Davis <edavis@littlestreamsoftware.com>
Mon, 20 Sep 2010 16:38:00 +0000 (16:38 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4164 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/user.rb

index c5c638f938baaf95192f864e721be391787b5049..5ae7a56d308c27e65d70c359839d8eaf796b067c 100644 (file)
@@ -352,6 +352,12 @@ class User < Principal
       false
     end
   end
+
+  # Is the user allowed to do the specified action on any project?
+  # See allowed_to? for the actions and valid options.
+  def allowed_to_globally?(action, options)
+    allowed_to?(action, nil, options.reverse_merge(:global => true))
+  end
   
   def self.current=(user)
     @current_user = user