mirror of https://github.com/Chocobozzz/PeerTube
Client: fix update button displayed on non owned video
parent
b1ed221747
commit
9eee32fc34
|
@ -93,6 +93,10 @@ export class Video {
|
|||
return user && user.isAdmin() === true && this.isLocal === false;
|
||||
}
|
||||
|
||||
isUpdatableBy(user) {
|
||||
return user && this.isLocal === true && user.username === this.author;
|
||||
}
|
||||
|
||||
isVideoNSFWForUser(user: User) {
|
||||
// If the video is NSFW and the user is not logged in, or the user does not want to display NSFW videos...
|
||||
return (this.nsfw && (!user || user.displayNSFW === false));
|
||||
|
|
|
@ -229,8 +229,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
|||
}
|
||||
|
||||
canUserUpdateVideo() {
|
||||
return this.authService.getUser() !== null &&
|
||||
this.authService.getUser().username === this.video.author;
|
||||
return this.video.isUpdatableBy(this.authService.getUser());
|
||||
}
|
||||
|
||||
isVideoRemovable() {
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Test video abuses', function () {
|
|||
let servers = []
|
||||
|
||||
before(function (done) {
|
||||
this.timeout(30000)
|
||||
this.timeout(40000)
|
||||
|
||||
series([
|
||||
// Run servers
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('Test video blacklists', function () {
|
|||
let servers = []
|
||||
|
||||
before(function (done) {
|
||||
this.timeout(30000)
|
||||
this.timeout(40000)
|
||||
|
||||
series([
|
||||
// Run servers
|
||||
|
|
Loading…
Reference in New Issue