Class: Arkaan::Account

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::SecurePassword, Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/arkaan/account.rb

Overview

A user account with all related attributes. It holds credentials and informations about a designated user.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#applicationsArray<Arkaan::OAuth::Application] the applications this user has created and owns.

Returns Array<Arkaan::OAuth::Application] the applications this user has created and owns.

Returns:



37
# File 'lib/arkaan/account.rb', line 37

has_many :applications, class_name: 'Arkaan::OAuth::Application', inverse_of: :creator

#authorizationsArray<Arkaan::OAuth::Authorization>

Returns the authorization issued by this account to third-party applications to access its data.

Returns:



40
# File 'lib/arkaan/account.rb', line 40

has_many :authorizations, class_name: 'Arkaan::OAuth::Authorization', inverse_of: :account

#emailString

Returns the email address of the user, useful to contact them ; it must be given, unique, and have an email format.

Returns:

  • (String)

    the email address of the user, useful to contact them ; it must be given, unique, and have an email format.



23
# File 'lib/arkaan/account.rb', line 23

field :email, type: String

#firstnameString

Returns the first name of the user.

Returns:

  • (String)

    the first name of the user.



20
# File 'lib/arkaan/account.rb', line 20

field :firstname, type: String, default: ''

#groupsArray<Arkaan::Permissions::Group>

Returns the groups giving their corresponding rights to the current account.

Returns:



33
# File 'lib/arkaan/account.rb', line 33

has_and_belongs_to_many :groups, class_name: 'Arkaan::Permissions::Group', inverse_of: :accounts

#invitationsArray<Arkaan::Campaigns::Invitation>

Returns the invitations you’ve issued yourself to other players.

Returns:



49
# File 'lib/arkaan/account.rb', line 49

has_many :invitations, class_name: 'Arkaan::Campaigns::Invitation', inverse_of: :account

#lastnameString

Returns the last name (family name) of the user.

Returns:

  • (String)

    the last name (family name) of the user.



17
# File 'lib/arkaan/account.rb', line 17

field :lastname, type: String, default: ''

#password=(value) ⇒ String (writeonly)

Returns password, in clear, of the user ; do not attempt to get the value, just set it when changing the password.

Returns:

  • (String)

    password, in clear, of the user ; do not attempt to get the value, just set it when changing the password.



29
# File 'lib/arkaan/account.rb', line 29

has_secure_password validations: false

#password_confirmation=(value) ⇒ String (writeonly)

Returns the confirmation of the password, do not get, just set it ; it must be the same as the password.

Returns:

  • (String)

    the confirmation of the password, do not get, just set it ; it must be the same as the password.



29
# File 'lib/arkaan/account.rb', line 29

has_secure_password validations: false

#password_digestString (readonly)

Returns the password of the user, encrypted with the Blowfish algorithm.

Returns:

  • (String)

    the password of the user, encrypted with the Blowfish algorithm.



14
# File 'lib/arkaan/account.rb', line 14

field :password_digest, type: String

#phonesArray<Arkaan::Phone>

Returns the phone numbers given by the user.

Returns:

  • (Array<Arkaan::Phone>)

    the phone numbers given by the user.



59
# File 'lib/arkaan/account.rb', line 59

embeds_many :phones, class_name: 'Arkaan::Phone', inverse_of: :account

#servicesArray<Arkaan::Monitoring::Service>

Returns the services created by this user.

Returns:



43
# File 'lib/arkaan/account.rb', line 43

has_many :services, class_name: 'Arkaan::Monitoring::Service', inverse_of: :creator

#sessionsArray<Arkaan::Authentication::Session>

Returns the sessions on which this account is, or has been logged in.

Returns:



46
# File 'lib/arkaan/account.rb', line 46

has_many :sessions, class_name: 'Arkaan::Authentication::Session', inverse_of: :account

#usernameString

Returns the nickname the user chose at subscription, must be given, unique, and 6 or more characters long.

Returns:

  • (String)

    the nickname the user chose at subscription, must be given, unique, and 6 or more characters long.



11
# File 'lib/arkaan/account.rb', line 11

field :username, type: String

#websocketsArray<Arkaan::Monitoring::Websocket>

Returns the websockets created by the owner of this account.

Returns:



55
# File 'lib/arkaan/account.rb', line 55

has_many :websockets, class_name: 'Arkaan::Monitoring::Websocket', inverse_of: :creator