aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account/user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/account/user.ts')
-rw-r--r--server/models/account/user.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index 74cf0f4a8..afa9d7be0 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -13,6 +13,7 @@ import { comparePassword, cryptPassword } from '../../helpers/peertube-crypto'
13import { OAuthTokenModel } from '../oauth/oauth-token' 13import { OAuthTokenModel } from '../oauth/oauth-token'
14import { getSort, throwIfNotValid } from '../utils' 14import { getSort, throwIfNotValid } from '../utils'
15import { VideoChannelModel } from '../video/video-channel' 15import { VideoChannelModel } from '../video/video-channel'
16import { VideoCommentModel } from '../video/video-comment'
16import { AccountModel } from './account' 17import { AccountModel } from './account'
17 18
18@DefaultScope({ 19@DefaultScope({
@@ -226,6 +227,14 @@ export class UserModel extends Model<UserModel> {
226 }) 227 })
227 } 228 }
228 229
230 static async getStats () {
231 const totalUsers = await UserModel.count()
232
233 return {
234 totalUsers
235 }
236 }
237
229 hasRight (right: UserRight) { 238 hasRight (right: UserRight) {
230 return hasUserRight(this.role, right) 239 return hasUserRight(this.role, right)
231 } 240 }