Sha256: 6a4018f67e1f0995a9910cc7c98c86434d03793d81489110f7795e7cbb82734d

Contents?: true

Size: 525 Bytes

Versions: 46

Compression:

Stored size: 525 Bytes

Contents

require 'singleton'

class AnonymousUser
  include Singleton

  def is_admin?
    false
  end

  def is_anonymous?
    true
  end

  def is_human?
    true
  end

  def is_application?
    false
  end

  def id
    nil
  end

  def authentications 
    []
  end

  def identity
    nil
  end

  # Necessary if an anonymous user ever runs into an Exception
  # or else the developer email doesn't work
  def username
    'anonymous'
  end

  def full_name
    "Anonymous User"
  end

  def casual_name
    full_name
  end

end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
openstax_accounts-6.3.2 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.3.1 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.3.0 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.2.0 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.7 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.6 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.5 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.4 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.3 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.2 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.1 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.1.0 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-6.0.0 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-5.2.0 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-5.1.2 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-5.1.1 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-5.1.0 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-5.0.1 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-5.0.0 spec/dummy/app/models/anonymous_user.rb
openstax_accounts-4.1.1 spec/dummy/app/models/anonymous_user.rb