diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-10 10:02:23 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-10 10:02:23 +0100 |
commit | cd3d847d63239802553b19f359c290a08fa0850c (patch) | |
tree | 1092b8cf811665c6d33c1e8cb50b5a8aa3a007fb /client/src/app/videos/+video-edit/video-add.component.ts | |
parent | 5e6c69cedd39d7df2d6ceedacad0ac51e6f6862a (diff) | |
download | PeerTube-cd3d847d63239802553b19f359c290a08fa0850c.tar.gz PeerTube-cd3d847d63239802553b19f359c290a08fa0850c.tar.zst PeerTube-cd3d847d63239802553b19f359c290a08fa0850c.zip |
Add a warning when uploading videos using root
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add.component.ts')
-rw-r--r-- | client/src/app/videos/+video-edit/video-add.component.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts index 193de441d..911bc884e 100644 --- a/client/src/app/videos/+video-edit/video-add.component.ts +++ b/client/src/app/videos/+video-edit/video-add.component.ts | |||
@@ -2,7 +2,7 @@ import { Component, HostListener, ViewChild } from '@angular/core' | |||
2 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' | 2 | import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service' |
3 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' | 3 | import { VideoImportUrlComponent } from '@app/videos/+video-edit/video-add-components/video-import-url.component' |
4 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' | 4 | import { VideoUploadComponent } from '@app/videos/+video-edit/video-add-components/video-upload.component' |
5 | import { ServerService } from '@app/core' | 5 | import { AuthService, ServerService } from '@app/core' |
6 | import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' | 6 | import { VideoImportTorrentComponent } from '@app/videos/+video-edit/video-add-components/video-import-torrent.component' |
7 | 7 | ||
8 | @Component({ | 8 | @Component({ |
@@ -19,6 +19,7 @@ export class VideoAddComponent implements CanComponentDeactivate { | |||
19 | videoName: string | 19 | videoName: string |
20 | 20 | ||
21 | constructor ( | 21 | constructor ( |
22 | private auth: AuthService, | ||
22 | private serverService: ServerService | 23 | private serverService: ServerService |
23 | ) {} | 24 | ) {} |
24 | 25 | ||
@@ -57,4 +58,12 @@ export class VideoAddComponent implements CanComponentDeactivate { | |||
57 | isVideoImportTorrentEnabled () { | 58 | isVideoImportTorrentEnabled () { |
58 | return this.serverService.getConfig().import.videos.torrent.enabled | 59 | return this.serverService.getConfig().import.videos.torrent.enabled |
59 | } | 60 | } |
61 | |||
62 | isInSecondStep () { | ||
63 | return !!this.secondStepType | ||
64 | } | ||
65 | |||
66 | isRootUser () { | ||
67 | return this.auth.getUser().username === 'root' | ||
68 | } | ||
60 | } | 69 | } |