summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-09-20 16:38:00 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-09-20 16:38:00 +0000
commit6a76aef3752052e9f90517abd611a534fbb01849 (patch)
tree0e6d125a6af91c74f116e9b9062de3fc7af1afb1 /app/models
parent3bc29e29e091b56bcffeb07ffb9c37c328525f99 (diff)
downloadredmine-6a76aef3752052e9f90517abd611a534fbb01849.tar.gz
redmine-6a76aef3752052e9f90517abd611a534fbb01849.zip
Add User#allowed_to_globally? which wraps User#allowed_to?
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4164 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/user.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index c5c638f93..5ae7a56d3 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -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