-import { Component } from '@angular/core'
-import { UserRight } from '../../../../../shared'
-import { AuthService } from '@app/core/auth/auth.service'
+import { Component, OnInit } from '@angular/core'
+import { ServerService } from '@app/core'
@Component({
templateUrl: './moderation.component.html',
- styleUrls: [ './moderation.component.scss' ]
+ styleUrls: [ ]
})
-export class ModerationComponent {
- constructor (private auth: AuthService) {}
+export class ModerationComponent implements OnInit {
+ autoBlockVideosEnabled = false
- hasVideoAbusesRight () {
- return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_ABUSES)
- }
-
- hasVideoBlacklistRight () {
- return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
- }
+ constructor (
+ private serverService: ServerService
+ ) { }
- 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
}
}