/** * {@inheritDoc} */ @Override @PreAuthorize("(hasPermission(#post.topic.branch.id, 'BRANCH', 'BranchPermission.DELETE_OWN_POSTS') and " + "#comment.author.username == principal.username) or " + "(hasPermission(#post.topic.branch.id, 'BRANCH', 'BranchPermission.DELETE_OTHERS_POSTS') and " + "#comment.author.username != principal.username)") public PostComment markCommentAsDeleted(Post post, PostComment comment) { comment.setDeletionDate(new DateTime()); getDao().saveOrUpdate(comment); return comment; } }