Package ru.org.linux.auth

Examples of ru.org.linux.auth.AccessViolationException


  @RequestMapping(method=RequestMethod.GET)
  public ModelAndView showForm(ServletRequest request, @PathVariable String nick) throws Exception {
    Template tmpl = Template.getTemplate(request);

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

    ModelAndView mv = new ModelAndView("edit-remark");

    User user = userDao.getUser(nick);
    if (tmpl.isSessionAuthorized() && !tmpl.getNick().equals(nick) ) {
      mv.getModel().put("remark", userDao.getRemark(tmpl.getCurrentUser() , user) );
    }else{
      throw new AccessViolationException("Not Authorized");
    }
    return mv;
  }
View Full Code Here


          @PathVariable String nick
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized");
    }
    if(text.length()>255){
      text=text.substring(0,255);
    }
    User user = tmpl.getCurrentUser();
View Full Code Here

   * TODO проверка на бан в этой функции сбивает с толку
   * @throws AccessViolationException если пользователь блокирован или анонимен
   */
  public void checkAnonymous() throws AccessViolationException {
    if (anonymous || blocked) {
      throw new AccessViolationException("Anonymous user");
    }
  }
View Full Code Here

    }
  }

  public void checkBlocked() throws AccessViolationException {
    if (blocked) {
      throw new AccessViolationException("Пользователь заблокирован");
    }

    if (!activated) {
      throw new AccessViolationException("Пользователь не активирован");
    }
  }
View Full Code Here

    }
  }

  public void checkCommit() throws AccessViolationException {
    if (anonymous || blocked) {
      throw new AccessViolationException("Commit access denied for anonymous user");
    }
    if (!canmod) {
      throw new AccessViolationException("Commit access denied for user " + nick + " (" + id + ") ");
    }
  }
View Full Code Here

   *
   * @throws AccessViolationException if use is not super-moderator
   */
  public void checkDelete() throws AccessViolationException {
    if (anonymous || blocked) {
      throw new AccessViolationException("Delete access denied for anonymous user");
    }
    if (!candel) {
      throw new AccessViolationException("Delete access denied for user " + nick + " (" + id + ") ");
    }
  }
View Full Code Here

    ModelAndView modelAndView = new ModelAndView();

    User user = getUserByNickname(modelAndView, nick);

    if (!tmpl.isModeratorSession() && !user.equals(tmpl.getCurrentUser())) {
      throw new AccessViolationException("Вы не можете смотреть черновики другого пользователя");
    }

    modelAndView.addObject("url",
            UriComponentsBuilder.fromUriString("/people/{nick}/drafts").buildAndExpand(nick).encode().toUriString());
    modelAndView.addObject("whoisLink",
View Full Code Here

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

    if (!tmpl.isModeratorSession()) {
      throw new AccessViolationException("Not moderator");
    }

    ModelAndView mv = new ModelAndView("setpostscore");
    Topic message = messageDao.getById(msgid);
    mv.addObject("message", message);
View Full Code Here

    @RequestParam(defaultValue="false") boolean notop
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);

    if (!tmpl.isModeratorSession()) {
      throw new AccessViolationException("Not moderator");
    }

    if (postscore < TopicPermissionService.POSTSCORE_UNRESTRICTED) {
      throw new UserErrorException("invalid postscore " + postscore);
    }
View Full Code Here

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

    if (!tmpl.isModeratorSession()) {
      throw new AccessViolationException("Not moderator");
    }

    Topic msg = messageDao.getById(msgid);

    if (msg.isDeleted()) {
      throw new AccessViolationException("Сообщение удалено");
    }

    Group newGrp = groupDao.getGroup(newgr);

    if (msg.getGroupId()!=newGrp.getId()) {
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.