if (!tmpl.isModeratorSession()) {
throw new AccessViolationException("Not moderator");
}
if (postscore < TopicPermissionService.POSTSCORE_UNRESTRICTED) {
throw new UserErrorException("invalid postscore " + postscore);
}
if (postscore > TopicPermissionService.POSTSCORE_UNRESTRICTED && postscore < TopicPermissionService.POSTSCORE_REGISTERED_ONLY) {
throw new UserErrorException("invalid postscore " + postscore);
}
if (postscore > TopicPermissionService.POSTSCORE_MODERATORS_ONLY) {
throw new UserErrorException("invalid postscore " + postscore);
}
User user = tmpl.getCurrentUser();
user.checkCommit();