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:
parent
6b09aba90d
commit
e69219184b
15 changed files with 287 additions and 59 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue