diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:54:59 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:54:59 +0200 |
commit | 70c065d64c330196d371941d9294a55da6e3aa37 (patch) | |
tree | 4532a9611502135bedb1cc6009c706e31f1f9be4 /server/models/user/user.ts | |
parent | 74889a71fe687dda74f2a687653122327807af36 (diff) | |
download | PeerTube-70c065d64c330196d371941d9294a55da6e3aa37.tar.gz PeerTube-70c065d64c330196d371941d9294a55da6e3aa37.tar.zst PeerTube-70c065d64c330196d371941d9294a55da6e3aa37.zip |
Add this context to instance model functions
Diffstat (limited to 'server/models/user/user.ts')
-rw-r--r-- | server/models/user/user.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/models/user/user.ts b/server/models/user/user.ts index d78f5f845..6b2410259 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts | |||
@@ -131,7 +131,7 @@ function beforeCreateOrUpdate (user: UserInstance) { | |||
131 | 131 | ||
132 | // ------------------------------ METHODS ------------------------------ | 132 | // ------------------------------ METHODS ------------------------------ |
133 | 133 | ||
134 | isPasswordMatch = function (password: string, callback: UserMethods.IsPasswordMatchCallback) { | 134 | isPasswordMatch = function (this: UserInstance, password: string, callback: UserMethods.IsPasswordMatchCallback) { |
135 | return comparePassword(password, this.password, callback) | 135 | return comparePassword(password, this.password, callback) |
136 | } | 136 | } |
137 | 137 | ||
@@ -146,7 +146,7 @@ toFormatedJSON = function (this: UserInstance) { | |||
146 | } | 146 | } |
147 | } | 147 | } |
148 | 148 | ||
149 | isAdmin = function () { | 149 | isAdmin = function (this: UserInstance) { |
150 | return this.role === USER_ROLES.ADMIN | 150 | return this.role === USER_ROLES.ADMIN |
151 | } | 151 | } |
152 | 152 | ||