Class: AnonymousUser

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

Constant Summary

Constants inherited from User

User::MAIL_NOTIFICATION_OPTIONS, User::STATUS_ACTIVE, User::STATUS_ANONYMOUS, User::STATUS_LOCKED, User::STATUS_REGISTERED, User::USER_FORMATS

Instance Attribute Summary

Attributes inherited from User

#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, #before_create, #before_save, #change_password_allowed?, #check_password?, current, current=, find_by_api_key, find_by_login, find_by_mail, find_by_rss_key, #identity_url=, #lock, #lock!, #locked?, #mail=, #member_of?, #notified_project_ids=, #notified_projects_ids, #notify_about?, #pref, #projects_by_role, #random_password, #register, #register!, #registered?, #reload, #roles_for_project, #salt_password, salt_unsalted_passwords!, #to_s, #today, try_to_autologin, try_to_login, valid_notification_options, #valid_notification_options, #wants_comments_in_reverse_order?

Methods included from Redmine::SafeAttributes

#delete_unsafe_attributes, included, #safe_attribute_names, #safe_attributes=

Methods inherited from Principal

#<=>

Instance Method Details

#adminObject



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

def admin; false end

#available_custom_fieldsObject



579
580
581
# File 'app/models/user.rb', line 579

def available_custom_fields
  []
end

#destroyObject

Anonymous user can not be destroyed



592
593
594
# File 'app/models/user.rb', line 592

def destroy
  false
end

#logged?Boolean

Overrides a few properties

Returns:

  • (Boolean)


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

def logged?; false end

#mailObject



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

def mail; nil end

#name(*args) ⇒ Object



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

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

#rss_keyObject



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

def rss_key; nil end

#time_zoneObject



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

def time_zone; nil end

#validate_on_createObject



574
575
576
577
# File 'app/models/user.rb', line 574

def validate_on_create
  # There should be only one AnonymousUser in the database
  errors.add_to_base 'An anonymous user already exists.' if AnonymousUser.find(:first)
end