Browse Source

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
tags/1.1.0
Eric Davis 13 years ago
parent
commit
6a76aef375
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      app/models/user.rb

+ 6
- 0
app/models/user.rb View 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

Loading…
Cancel
Save