Class: AuthorizedUser

Defined in: src/user/authorized.coffee
Inherits: AbstractUser

Overview

A simple model class providing convenience methods for working with authorized users.

Instance Method Summary

Inherited Method Summary

Methods inherited from AbstractUser

#constructor, #uncache, #assets

Constructor Details

- (void) constructor(client, attributes)

Create a new User. Possible attributes are Username, Password, EmailAddress, Firstname, Lastname, DateOfBirth, Status, Metadata, FacebookId.

Users should normally be created by Totem, and retrieved using Totem#user.

Parameters:

  • client (Object) A hapilib restClient
  • attributes (Object) Attributes describing the user

Instance Method Details

- (Object) goods()

Get goods available to the user.

Returns:

  • (Object) — A promise, resolving to an array of goods data

- (Object) avatars(options = {})

Get avatars the user has created. Should normally be accessed via Totem#avatars.

Parameters:

  • options (Object) Options to use in fetching avatars

Options Hash: (option):

  • assets (Boolean) Get associated assets when fetching avatars. Defaults to true
  • Label (String) Get a particular avatar by its label
  • Id (String/Integer) Get a particular avatar by its id

Returns:

  • (Object) — A promise, resolving to an array of avatar data