Sha256: db98059c188301db6b5a6be923bf3991971a948ffc3695ada6abf269e442a6a0

Contents?: true

Size: 984 Bytes

Versions: 192

Compression:

Stored size: 984 Bytes

Contents

module Origen
  # Methods related to individual users and groups
  module Users
    autoload :User,   'origen/users/user'
    autoload :LDAP,   'origen/users/ldap'

    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

    # Returns a user object representing the current user, will return a default
    # user object if the current user is not known to the generator
    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

    # Returns all admin user objects
    def admins
      app_users.select(&:admin?)
    end
    alias_method :developers, :admins
  end
end

Version data entries

192 entries across 192 versions & 1 rubygems

Version Path
origen-0.60.18 lib/origen/users.rb
origen-0.60.17 lib/origen/users.rb
origen-0.60.16 lib/origen/users.rb
origen-0.60.14 lib/origen/users.rb
origen-0.60.13 lib/origen/users.rb
origen-0.60.12 lib/origen/users.rb
origen-0.60.11 lib/origen/users.rb
origen-0.60.10 lib/origen/users.rb
origen-0.60.9 lib/origen/users.rb
origen-0.60.8 lib/origen/users.rb
origen-0.60.7 lib/origen/users.rb
origen-0.60.6 lib/origen/users.rb
origen-0.60.5 lib/origen/users.rb
origen-0.60.4 lib/origen/users.rb
origen-0.60.3 lib/origen/users.rb
origen-0.60.2 lib/origen/users.rb
origen-0.60.1 lib/origen/users.rb
origen-0.60.0 lib/origen/users.rb
origen-0.59.8 lib/origen/users.rb
origen-0.59.7 lib/origen/users.rb