clinical:user-model

v1.4.0Published 8 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

clinical:user-model

A model for a user which contains useful methods and can be extended by other packages by extending it's prototype to add methods that add functionality that are pertinent to their purpose. For example the socialize:friendships package extends the user model to provide helpers which return friend requests and friends for the user.

======================================

User() - Extends BaseModel

User.prototype.displayName() - A representation of the user. "You" if the instance is the same as the current user, instance.username otherwise.

User.prototype.isSelf(user) - Checks if one user is another user by comparing _ids.

User.prototype.defaultEmail - Returns the first email address in the list of emails.

======================================

Licensing

MIT. Use as you will.