Class: AnonymousUser

Inherits:
User show all
Defined in:
app/models/user.rb

Constant Summary

Constants inherited from User

User::CSS_CLASS_BY_STATUS, User::LOGIN_LENGTH_LIMIT, User::MAIL_LENGTH_LIMIT, User::MAIL_NOTIFICATION_OPTIONS, User::USER_FORMATS

Constants inherited from Principal

Principal::STATUS_ACTIVE, Principal::STATUS_ANONYMOUS, Principal::STATUS_LOCKED, Principal::STATUS_REGISTERED

Instance Attribute Summary

Attributes inherited from User

#generate_password, #last_before_login_on, #password, #password_confirmation

Instance Method Summary collapse

Methods inherited from User

#activate, #activate!, #active?, #allowed_to?, #allowed_to_globally?, anonymous, #anonymous?, #api_key, #base_reload, #change_password_allowed?, #check_password?, #css_classes, current, current=, default_admin_account_changed?, fields_for_order_statement, find_by_api_key, find_by_login, find_by_mail, find_by_rss_key, find_or_initialize_by_identity_url, #force_default_language?, #generate_password?, #identity_url=, #is_or_belongs_to?, #language, #lock, #lock!, #locked?, #mail=, #must_change_password?, name_formatter, #notified_project_ids=, #notified_projects_ids, #notify_about?, #own_account_deletable?, #projects_by_role, #random_password, #register, #register!, #registered?, #reload, #roles_for_project, #salt_password, salt_unsalted_passwords!, #set_mail_notification, #time_to_date, #to_s, #today, try_to_autologin, try_to_login, #update_hashed_password, valid_notification_options, #valid_notification_options, #visible_project_ids, #wants_comments_in_reverse_order?

Methods included from Redmine::SafeAttributes

#delete_unsafe_attributes, included, #safe_attribute?, #safe_attribute_names, #safe_attributes=

Methods inherited from Principal

#<=>, fields_for_order_statement, #visible?

Instance Method Details

#adminObject


780
# File 'app/models/user.rb', line 780

def admin; false end

#available_custom_fieldsObject


774
775
776
# File 'app/models/user.rb', line 774

def available_custom_fields
  []
end

#builtin_roleObject

Returns the user's bult-in role


791
792
793
# File 'app/models/user.rb', line 791

def builtin_role
  @builtin_role ||= Role.anonymous
end

#destroyObject

Anonymous user can not be destroyed


804
805
806
# File 'app/models/user.rb', line 804

def destroy
  false
end

#logged?Boolean

Overrides a few properties

Returns:

  • (Boolean)

779
# File 'app/models/user.rb', line 779

def logged?; false end

#mailObject


782
# File 'app/models/user.rb', line 782

def mail; nil end

#member_of?(*args) ⇒ Boolean

Returns:

  • (Boolean)

799
800
801
# File 'app/models/user.rb', line 799

def member_of?(*args)
  false
end

#membership(*args) ⇒ Object


795
796
797
# File 'app/models/user.rb', line 795

def membership(*args)
  nil
end

#name(*args) ⇒ Object


781
# File 'app/models/user.rb', line 781

def name(*args); I18n.t(:label_user_anonymous) end

#prefObject


786
787
788
# File 'app/models/user.rb', line 786

def pref
  UserPreference.new(:user => self)
end

#rss_keyObject


784
# File 'app/models/user.rb', line 784

def rss_key; nil end

#time_zoneObject


783
# File 'app/models/user.rb', line 783

def time_zone; nil end

#validate_anonymous_uniquenessObject


769
770
771
772
# File 'app/models/user.rb', line 769

def validate_anonymous_uniqueness
  # There should be only one AnonymousUser in the database
  errors.add :base, 'An anonymous user already exists.' if AnonymousUser.exists?
end