Sha256: 90043c44a085008f2f71b1ec763de04ebea9c05b7a572180c7f9a2506c12deb3
Contents?: true
Size: 903 Bytes
Versions: 3
Compression:
Stored size: 903 Bytes
Contents
module AuthLh class User attr_accessor :email, :jabber, :first_name, :last_name, :login, :shop_code, :shop_id, :shop_name, :enabled, :role_codes, :password_expired, :has_remote_desktop, :attendance_mode, :fingerprint_from, :fingerprint_to, :external_apps def initialize(attributes={}) attributes.each do |k,v| if k.to_s == 'external_apps' self.external_apps = v.map { |x| ExternalApp.new(x) } else self.send("#{k}=", v) end end end def name "#{first_name} #{last_name}" end def has_role?(role_code) role_codes.include?(role_code.to_s) end def has_some_role?(r_codes) r_codes.any? { |r_code| role_codes.include?(r_code.to_s) } end def has_all_roles?(r_codes) r_codes.all? { |r_code| role_codes.include?(r_code.to_s) } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
auth-lh-0.16.0 | lib/auth_lh/user.rb |
auth-lh-0.15.0 | lib/auth_lh/user.rb |
auth-lh-0.14.2 | lib/auth_lh/user.rb |