+// ------------------------------ METHODS ------------------------------
+
+function isPasswordMatch (password, callback) {
+ return peertubeCrypto.comparePassword(password, this.password, callback)
+}
+
+function toFormatedJSON () {
+ return {
+ id: this._id,
+ username: this.username,
+ role: this.role,
+ createdDate: this.createdDate
+ }
+}
+// ------------------------------ STATICS ------------------------------
+
+function countTotal (callback) {
+ return this.count(callback)
+}
+
+function getByUsername (username) {
+ return this.findOne({ username: username })
+}