Package ru.org.linux.auth

Examples of ru.org.linux.auth.AccessViolationException


    @RequestParam("voteid") int voteid
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized");
    }

    User user = tmpl.getCurrentUser();

    Poll poll = pollDao.getCurrentPoll();
View Full Code Here


    HttpServletRequest request
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized");
    }

    Map<String, Object> params = new HashMap<>();

    Topic msg = messageDao.getById(msgid);
View Full Code Here

    Map<String, Object> params = new HashMap<>();

    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("нет авторизации");
    }

    params.put("msgid", msgid);

    Comment comment = commentService.getById(msgid);

    if (comment.isDeleted()) {
      throw new UserErrorException("комментарий уже удален");
    }

    int topicId = comment.getTopicId();

    Topic topic = messageDao.getById(topicId);

    if (topic.isDeleted()) {
      throw new AccessViolationException("тема удалена");
    }

    params.put("topic", topic);

    CommentList comments = commentService.getCommentList(topic, tmpl.isModeratorSession());
View Full Code Here

    }

    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("нет авторизации");
    }

    User user = tmpl.getCurrentUser();
    user.checkBlocked();
    user.checkAnonymous();
View Full Code Here

            commentRequest.getTopic(),
            tmpl.getCurrentUser()
    );

    if (!editable) {
      throw new AccessViolationException("у Вас нет прав на редактирование этого сообщения");
    }

    if (commentRequest.isPreviewMode() || errors.hasErrors() && comment == null) {
      ModelAndView modelAndView = new ModelAndView("edit_comment", formParams);
      modelAndView.addObject("ipBlockInfo", ipBlockInfo);
View Full Code Here

    @RequestParam(value = "firstLetter", required = false, defaultValue = "") String firstLetter,
    @RequestParam("tagName") String oldTagName
  ) throws AccessViolationException {
    Template template = Template.getTemplate(request);
    if (!template.isModeratorSession()) {
      throw new AccessViolationException(REJECT_REASON);
    }
    TagRequest.Change tagRequestChange = new TagRequest.Change();
    tagRequestChange.setOldTagName(oldTagName);
    tagRequestChange.setTagName(oldTagName);
    ModelAndView modelAndView = new ModelAndView("tags-change");
View Full Code Here

    @ModelAttribute("tagRequestChange") TagRequest.Change tagRequestChange,
    Errors errors
  ) throws AccessViolationException {
    Template template = Template.getTemplate(request);
    if (!template.isModeratorSession()) {
      throw new AccessViolationException(REJECT_REASON);
    }

    tagModificationService.change(tagRequestChange.getOldTagName(), tagRequestChange.getTagName(), errors);

    if (!errors.hasErrors()) {
View Full Code Here

    @RequestParam(value = "firstLetter", required = false, defaultValue = "") String firstLetter,
    @RequestParam("tagName") String oldTagName
  ) throws AccessViolationException {
    Template template = Template.getTemplate(request);
    if (!template.isModeratorSession()) {
      throw new AccessViolationException(REJECT_REASON);
    }
    TagRequest.Delete tagRequestDelete = new TagRequest.Delete();
    tagRequestDelete.setOldTagName(oldTagName);
    ModelAndView modelAndView = new ModelAndView("tags-delete");
    modelAndView.addObject("firstLetter", firstLetter);
View Full Code Here

    @ModelAttribute("tagRequestDelete") TagRequest.Delete tagRequestDelete,
    Errors errors
  ) throws AccessViolationException {
    Template template = Template.getTemplate(request);
    if (!template.isModeratorSession()) {
      throw new AccessViolationException(REJECT_REASON);
    }

    tagModificationService.delete(tagRequestDelete.getOldTagName(), tagRequestDelete.getTagName(), errors);

    if (!errors.hasErrors()) {
View Full Code Here

    @PathVariable String nick,
    HttpServletRequest request
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);
    if (!tmpl.isModeratorSession()) {
      throw new AccessViolationException("Not moderator");
    }

    ModelAndView mv = new ModelAndView("deleted-comments");

    User user = userDao.getUser(nick);
View Full Code Here

TOP

Related Classes of ru.org.linux.auth.AccessViolationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.