X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Fmoderation%2Fmoderation.component.ts;h=44dd11c47e79296526f6e68c8cb82602a2826f58;hb=ac27887774e63d99f4e227fbe18846f143cc4b3c;hp=47154af3ffb6cd53b7ff9aef2547d92ee9002b82;hpb=97567dd81f508dd6295ac4d73d849aa2ce0a6549;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+admin/moderation/moderation.component.ts b/client/src/app/+admin/moderation/moderation.component.ts index 47154af3f..44dd11c47 100644 --- a/client/src/app/+admin/moderation/moderation.component.ts +++ b/client/src/app/+admin/moderation/moderation.component.ts @@ -1,34 +1,20 @@ -import { Component } from '@angular/core' -import { UserRight } from '../../../../../shared' -import { AuthService, ServerService } from '@app/core' +import { Component, OnInit } from '@angular/core' +import { ServerService } from '@app/core' @Component({ templateUrl: './moderation.component.html', - styleUrls: [ './moderation.component.scss' ] + styleUrls: [ ] }) -export class ModerationComponent { - autoBlacklistVideosEnabled: boolean +export class ModerationComponent implements OnInit { + autoBlockVideosEnabled = false constructor ( - private auth: AuthService, private serverService: ServerService - ) { - this.autoBlacklistVideosEnabled = this.serverService.getConfig().autoBlacklist.videos.ofUsers.enabled - } - - hasVideoAbusesRight () { - return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES) - } + ) { } - hasVideoBlacklistRight () { - return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) - } - - hasAccountsBlocklistRight () { - return this.auth.getUser().hasRight(UserRight.MANAGE_ACCOUNTS_BLOCKLIST) - } + ngOnInit (): void { + const serverConfig = this.serverService.getHTMLConfig() - hasServersBlocklistRight () { - return this.auth.getUser().hasRight(UserRight.MANAGE_SERVERS_BLOCKLIST) + this.autoBlockVideosEnabled = serverConfig.autoBlacklist.videos.ofUsers.enabled } }