mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
Improve AP actor checks
This commit is contained in:
parent
e587e0ecee
commit
12ba460e9e
5 changed files with 30 additions and 21 deletions
|
@ -94,6 +94,10 @@ function processDeleteVideoComment (byActor: ActorModel, videoComment: VideoComm
|
|||
logger.debug('Removing remote video comment "%s".', videoComment.url)
|
||||
|
||||
return sequelizeTypescript.transaction(async t => {
|
||||
if (videoComment.Account.id !== byActor.Account.id) {
|
||||
throw new Error('Account ' + byActor.url + ' does not own video comment ' + videoComment.url)
|
||||
}
|
||||
|
||||
await videoComment.destroy({ transaction: t })
|
||||
|
||||
if (videoComment.Video.isOwned()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue