mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Closed #8
This commit is contained in:
@ -51,6 +51,8 @@ class CommentController
|
||||
$this->context->transport->comments = $comments;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @route /post/{postId}/add-comment
|
||||
* @valdiate postId [0-9]+
|
||||
@ -78,4 +80,19 @@ class CommentController
|
||||
$this->context->transport->success = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @route /comment/{id}/delete
|
||||
* @validate id [0-9]+
|
||||
*/
|
||||
public function deleteAction($id)
|
||||
{
|
||||
$comment = Model_Comment::locate($id);
|
||||
$secondary = $comment->commenter->id == $this->context->user->id ? 'own' : 'all';
|
||||
PrivilegesHelper::confirmWithException($this->context->user, Privilege::DeleteComment, $secondary);
|
||||
R::trash($comment);
|
||||
$this->context->transport->success = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user