Package ru.org.linux.auth

Examples of ru.org.linux.auth.AccessViolationException


      HttpServletRequest request,
      @RequestParam("id") User user
  ) throws Exception {
    User moderator = getModerator(request);
    if (user.getScore()<User.CORRECTOR_SCORE) {
      throw new AccessViolationException("Пользователя " + user.getNick() + " нельзя сделать корректором");
    }
    userDao.toggleCorrector(user, moderator);
    logger.info("Toggle corrector " + user.getNick() + " by " + moderator.getNick());

    return redirectToProfile(user);
View Full Code Here


      @RequestParam("id") User user
  ) throws Exception {
    User moderator = getModerator(request);

    if (user.isModerator()) {
      throw new AccessViolationException("Пользователю " + user.getNick() + " нельзя сбросить пароль");
    }

    userDao.resetPassword(user, moderator);

    logger.info("Пароль "+user.getNick()+" сброшен модератором "+moderator.getNick());
View Full Code Here

      HttpServletRequest request,
      @RequestParam("id") User user
  ) throws Exception {
    User moderator = getModerator(request);
    if (user.isModerator()) {
      throw new AccessViolationException("Пользователю " + user.getNick() + " нельзя удалить сведения");
    }
    userDao.removeUserInfo(user, moderator);
    logger.info("Clearing " + user.getNick() + " userinfo by " + moderator.getNick());

    return redirectToProfile(user);
View Full Code Here

    @RequestParam("id") User user
  ) throws Exception {
    Template tmpl = Template.getTemplate(request);

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

    User currentUser = tmpl.getCurrentUser();

    // Не модератор не может удалять чужие аватары
    if (!tmpl.isModeratorSession() && currentUser.getId()!=user.getId()) {
      throw new AccessViolationException("Not permitted");
    }

    if (user.getPhoto() != null && userDao.resetUserpic(user, currentUser)) {
      logger.info("Clearing " + user.getNick() + " userpic by " + currentUser.getNick());
    } else {
View Full Code Here

  @RequestMapping(value="/groupmod.jsp", method = RequestMethod.GET)
  public ModelAndView showForm(@RequestParam("group") int id, ServletRequest request) throws Exception {
    Template tmpl = Template.getTemplate(request);

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

    Group group = groupDao.getGroup(id);

    ModelAndView mv = new ModelAndView("groupmod", "group", group);
View Full Code Here

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

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

    Group group = groupDao.getGroup(id);

    if (preview != null) {
View Full Code Here

    user.checkBlocked();
    user.checkAnonymous();

    if (user.isModerator() && !tmpl.isModeratorSession()) {
      throw new AccessViolationException("этот пароль могут сбросить только модераторы");
    }

    if (!tmpl.isModeratorSession() && !userDao.canResetPassword(user)) {
      throw new BadInputException("Нельзя запрашивать пароль чаще одного раза в неделю!");
    }
View Full Code Here

    @RequestParam(value = "newIgnoredTagName", required = false) String newIgnoredTagName
  ) throws AccessViolationException {
    Template tmpl = Template.getTemplate(request);

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

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

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

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

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

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

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

    User user = tmpl.getCurrentUser();
    user.checkAnonymous();
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.