1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Implement user blocking on server side

This commit is contained in:
Chocobozzz 2018-08-08 14:58:21 +02:00
parent 6b09aba90d
commit e69219184b
No known key found for this signature in database
GPG key ID: 583A612D890159BE
15 changed files with 287 additions and 59 deletions

View file

@ -21,6 +21,7 @@ import { hasUserRight, USER_ROLE_LABELS, UserRight } from '../../../shared'
import { User, UserRole } from '../../../shared/models/users'
import {
isUserAutoPlayVideoValid,
isUserBlockedValid,
isUserNSFWPolicyValid,
isUserPasswordValid,
isUserRoleValid,
@ -100,6 +101,12 @@ export class UserModel extends Model<UserModel> {
@Column
autoPlayVideo: boolean
@AllowNull(false)
@Default(false)
@Is('UserBlocked', value => throwIfNotValid(value, isUserBlockedValid, 'blocked boolean'))
@Column
blocked: boolean
@AllowNull(false)
@Is('UserRole', value => throwIfNotValid(value, isUserRoleValid, 'role'))
@Column