Class: UserMethods
| Defined in: | src/methods/user-methods.coffee |
Overview
Provides methods to interact with scotties.
Instance Method Summary
- # (void) all(accountId, options = {}, cb = function() {}) Bound Retrieve all users for a specific accountId
- # (void) get(userId, options = {}, cb = function() {}) Bound Retrieves a user by it's id.
- # (void) getByIds(idList = [], options = {}, cb = function() {}) Bound Retrieves users by passing a list of id's, which can be string or objectIds
- # (void) getByUsernames(accountId, usernames = [], options = {}, cb = function() {}) Bound Retrieves users by passing a list of usernames.
- # (void) lookup(accountId, q, options = {}, cb = function() {}) Bound Returns a list of users who match q.
- # (void) getByName(accountId, name, options = {}, cb = function() {}) Bound
- # (void) getByPrimaryEmail(accountId, email, options = {}, cb = function() {}) Bound
- # (void) getByNameOrId(accountId, nameOrId, options = {}, cb = function() {}) Bound
- # (void) patch(accountId, usernameOrId, obj = {}, options = {}, cb = function() {}) Bound
- # (void) delete(accountId, usernameOrId, options = {}, cb = function() {}) Bound
- # (void) destroy(accountId, usernameOrId, options = {}, cb = function() {}) Bound
- # (void) setPassword(accountId, usernameOrId, password, options = {}, cb = function() {}) Bound
- # (void) findUserByUsernameOrEmail(accountId, usernameOrEmail, options = {}, cb = function() {}) Bound Looks up a user by username or email.
- # (void) validateUserByUsernameOrEmail(accountId, usernameOrEmail, password, options = {}, cb = function() {}) Bound Looks up the user, if found validates against password.
- # (void) _hashPassword(password, cb) Bound
- # (void) create(accountId, objs = {}, options = {}, cb = function() {}) Bound Creates a new user.
- # (void) getOrCreateUserFromProvider(accountId, provider, v1, v2, profile, options = {}, cb = function() {}) Bound Gets or creates a user for a given provider/profile combination.
- # (void) _usernameFromProfile(profile) Bound
- # (void) _displayNameFromProfile(profile) Bound
- # (void) _profileImageFromProfile(profile) Bound
- # (void) addIdentityToUser(userId, provider, v1, v2, profile, options = {}, cb = function() {}) Bound Adds an identity to an existing user.
- # (void) removeIdentityFromUser(userId, identityId, options = {}, cb = function() {}) Bound
- # (void) addRoles(userId, roles, options = {}, cb = function() {}) Bound
- # (void) removeRoles(userId, roles, options = {}, cb = function() {}) Bound
- # (void) resetPassword(accountId, email, options = {}, cb = function() {}) Bound
- # (void) resetPasswordToken(accountId, token, password, options = {}, cb = function() {}) Bound p0qEeKBoh25031326eefa65c0000000006TWlhZKbLjn
- # (void) addEmail(userId, email, isValidated, options = {}, cb = function() {}) Bound
- # (void) removeEmail(userId, email, options = {}, cb = function() {}) Bound
Constructor Details
#
(void)
constructor(models)
Initializes a new instance of the UserMethods class.
Instance Method Details
#
(void)
all(accountId, options = {}, cb = function() {})
Bound
Retrieve all users for a specific accountId
#
(void)
get(userId, options = {}, cb = function() {})
Bound
Retrieves a user by it's id.
#
(void)
getByIds(idList = [], options = {}, cb = function() {})
Bound
Retrieves users by passing a list of id's, which can be string or objectIds
#
(void)
getByUsernames(accountId, usernames = [], options = {}, cb = function() {})
Bound
Retrieves users by passing a list of usernames.
#
(void)
lookup(accountId, q, options = {}, cb = function() {})
Bound
Returns a list of users who match q. In this version we do a straight user name match.
#
(void)
getByName(accountId, name, options = {}, cb = function() {})
Bound
#
(void)
getByPrimaryEmail(accountId, email, options = {}, cb = function() {})
Bound
#
(void)
getByNameOrId(accountId, nameOrId, options = {}, cb = function() {})
Bound
#
(void)
patch(accountId, usernameOrId, obj = {}, options = {}, cb = function() {})
Bound
#
(void)
delete(accountId, usernameOrId, options = {}, cb = function() {})
Bound
#
(void)
destroy(accountId, usernameOrId, options = {}, cb = function() {})
Bound
#
(void)
setPassword(accountId, usernameOrId, password, options = {}, cb = function() {})
Bound
#
(void)
findUserByUsernameOrEmail(accountId, usernameOrEmail, options = {}, cb = function() {})
Bound
Looks up a user by username or email.
#
(void)
validateUserByUsernameOrEmail(accountId, usernameOrEmail, password, options = {}, cb = function() {})
Bound
Looks up the user, if found validates against password. cb(err) in case of non password error. cb(null, user) in case of user not found, password not valid, or valid user
#
(void)
_hashPassword(password, cb)
Bound
#
(void)
create(accountId, objs = {}, options = {}, cb = function() {})
Bound
Creates a new user.
#
(void)
getOrCreateUserFromProvider(accountId, provider, v1, v2, profile, options = {}, cb = function() {})
Bound
Gets or creates a user for a given provider/profile combination.
#
(void)
_usernameFromProfile(profile)
Bound
#
(void)
_displayNameFromProfile(profile)
Bound
#
(void)
_profileImageFromProfile(profile)
Bound
#
(void)
addIdentityToUser(userId, provider, v1, v2, profile, options = {}, cb = function() {})
Bound
Adds an identity to an existing user. In this version, it replaces an existing provider of the same type.
#
(void)
removeIdentityFromUser(userId, identityId, options = {}, cb = function() {})
Bound
#
(void)
addRoles(userId, roles, options = {}, cb = function() {})
Bound
#
(void)
removeRoles(userId, roles, options = {}, cb = function() {})
Bound
#
(void)
resetPassword(accountId, email, options = {}, cb = function() {})
Bound
#
(void)
resetPasswordToken(accountId, token, password, options = {}, cb = function() {})
Bound
p0qEeKBoh25031326eefa65c0000000006TWlhZKbLjn
#
(void)
addEmail(userId, email, isValidated, options = {}, cb = function() {})
Bound
#
(void)
removeEmail(userId, email, options = {}, cb = function() {})
Bound