Module: Origen::Users
- Included in:
- Application, Application::Release, RegressionManager, Origen::Utility::Mailer
- Defined in:
- lib/origen/users.rb,
lib/origen/users/ldap.rb,
lib/origen/users/user.rb
Overview
Methods related to individual users and groups
Defined Under Namespace
Instance Method Summary collapse
-
#admins ⇒ Object
(also: #developers)
Returns all admin user objects.
- #app_users ⇒ Object
-
#current_user ⇒ Object
Returns a user object representing the current user, will return a default user object if the current user is not known to the generator.
Instance Method Details
#admins ⇒ Object Also known as: developers
Returns all admin user objects
26 27 28 |
# File 'lib/origen/users.rb', line 26 def admins app_users.select(&:admin?) end |
#app_users ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/origen/users.rb', line 7 def app_users # Had to do some shenanigans here due to Origen.root not being available # when this file is included, only load the users from the app once a user # method is first called # return @app_users if @app_users # require File.join(Origen.root, 'config', 'users') # @app_users = users [] end |
#current_user ⇒ Object
Returns a user object representing the current user, will return a default user object if the current user is not known to the generator
19 20 21 22 23 |
# File 'lib/origen/users.rb', line 19 def current_user core_id = Origen::Users::User.current_user_id user = app_users.find { |user| user.core_id == core_id } user || User.new(core_id) end |