module Origen::Users
Methods related to individual users and groups
Public Instance Methods
admins()
click to toggle source
Returns all admin user objects
# File lib/origen/users.rb, line 26 def admins app_users.select(&:admin?) end
Also aliased as: developers
app_users()
click to toggle source
# 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()
click to toggle source
Returns a user object representing the current user, will return a default user object if the current user is not known to the generator
# 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