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

Classes: LDAP, User

Instance Method Summary collapse

Instance Method Details

#adminsObject 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_usersObject


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_userObject

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