Example usage for com.liferay.portal.kernel.comment DiscussionPermission checkDeletePermission

List of usage examples for com.liferay.portal.kernel.comment DiscussionPermission checkDeletePermission

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.comment DiscussionPermission checkDeletePermission.

Prototype

public void checkDeletePermission(long commentId) throws PortalException;

Source Link

Usage

From source file:com.liferay.comment.internal.jsonws.CommentManagerJSONWS.java

License:Open Source License

public void deleteComment(long commentId) throws PortalException {
    DiscussionPermission discussionPermission = _commentManager.getDiscussionPermission(getPermissionChecker());

    discussionPermission.checkDeletePermission(commentId);

    _commentManager.deleteComment(commentId);
}

From source file:com.liferay.comment.taglib.internal.struts.EditDiscussionStrutsAction.java

License:Open Source License

protected void deleteComment(HttpServletRequest request) throws Exception {
    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

    long commentId = ParamUtil.getLong(request, "commentId");

    DiscussionPermission discussionPermission = _getDiscussionPermission(themeDisplay);

    discussionPermission.checkDeletePermission(commentId);

    _commentManager.deleteComment(commentId);
}