This commit is contained in:
Marcin Kurczewski
2013-10-17 23:37:41 +02:00
parent ee050cfd01
commit 379674d027
8 changed files with 59 additions and 5 deletions

View File

@ -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;
}
}