aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-08 14:58:21 +0200
committerChocobozzz <me@florianbigard.com>2018-08-08 15:22:58 +0200
commite69219184b1a3262ec5e617d30337b6431c9840c (patch)
tree959b32e1ed28047052604941870563e946be9de1 /server/models/account
parent6b09aba90dfe4c61331b66b1a6ef1f58ddc61485 (diff)
downloadPeerTube-e69219184b1a3262ec5e617d30337b6431c9840c.tar.gz
PeerTube-e69219184b1a3262ec5e617d30337b6431c9840c.tar.zst
PeerTube-e69219184b1a3262ec5e617d30337b6431c9840c.zip
Implement user blocking on server side
Diffstat (limited to 'server/models/account')
-rw-r--r--server/models/account/user.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/models/account/user.ts b/server/models/account/user.ts
index 1b1fc5ee8..ea6d63312 100644
--- a/server/models/account/user.ts
+++ b/server/models/account/user.ts
@@ -21,6 +21,7 @@ import { hasUserRight, USER_ROLE_LABELS, UserRight } from '../../../shared'
21import { User, UserRole } from '../../../shared/models/users' 21import { User, UserRole } from '../../../shared/models/users'
22import { 22import {
23 isUserAutoPlayVideoValid, 23 isUserAutoPlayVideoValid,
24 isUserBlockedValid,
24 isUserNSFWPolicyValid, 25 isUserNSFWPolicyValid,
25 isUserPasswordValid, 26 isUserPasswordValid,
26 isUserRoleValid, 27 isUserRoleValid,
@@ -101,6 +102,12 @@ export class UserModel extends Model<UserModel> {
101 autoPlayVideo: boolean 102 autoPlayVideo: boolean
102 103
103 @AllowNull(false) 104 @AllowNull(false)
105 @Default(false)
106 @Is('UserBlocked', value => throwIfNotValid(value, isUserBlockedValid, 'blocked boolean'))
107 @Column
108 blocked: boolean
109
110 @AllowNull(false)
104 @Is('UserRole', value => throwIfNotValid(value, isUserRoleValid, 'role')) 111 @Is('UserRole', value => throwIfNotValid(value, isUserRoleValid, 'role'))
105 @Column 112 @Column
106 role: number 113 role: number