Examples of NotAllowedException


Examples of pt.opensoft.webmvc.action.NotAllowedException

    super();
  }

  public void allows(HttpRequest request, ActionWrapper actionWrapper) {
    if (!isSecure(request)) {
      throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
    }
  }
View Full Code Here

Examples of pt.opensoft.webmvc.action.NotAllowedException

    if (request.isPost()) {
      return;
    }

    if (request.isGet()) {
          throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
        }

        throw new RuntimeException("Invalid method: " + request.getMethod());
  }
View Full Code Here

Examples of pt.opensoft.webmvc.action.NotAllowedException

    if (!isHttpAllowed(moduleName, actionName)) {
      if (!isSecure(request)) {
        // se est� a tentar aceder por http, removo o utilizador da sess�o
        request.getSession().remove(parameters.getString("session.user.tag", "user"));
        throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
      }

      return;
    }

    throw new NotAllowedException(this.getClass().getSimpleName() + " refused access to " + actionWrapper);
  }
View Full Code Here

Examples of service.exception.NotAllowedException

        }

        // check if the rater is allowed to rate the student for the specified
        // subject if not throw a NotAllowedException
        if (User.ADMIN != rater && !subject.getRaters().contains(rater)) {
            throw new NotAllowedException(rater + " is not allowed to rate ");
        }

        // check if for the given subject exists at least one rating
        // if not create a new empty list
        if (l == null) {
View Full Code Here

Examples of service.exception.NotAllowedException

        l.add(new DefaulRating(subject, rater, student, grade));
    }

    public Map<Rateable, List<Rating>> getRatings(User requester, Student student) throws NotAllowedException {
        if (!requester.equals(student) && requester != User.ADMIN) {
            throw new NotAllowedException(requester + " is not allowed to retrieve the ratings for " + student);
        }

        Map<Rateable, List<Rating>> userRatings = ratings.get(student);

        if (userRatings == null) {
View Full Code Here

Examples of service.exception.NotAllowedException

        return new HashMap<Rateable, List<Rating>>(userRatings);
    }

    public List<Rating> getRatings(User requester, Rateable subject, Student student) throws NotAllowedException {
        if (!requester.equals(student) && !subject.getRaters().contains(requester) && requester != User.ADMIN) {
            throw new NotAllowedException(requester + " is not allowed to retrieve the ratings for " + student);
        }

        Map<Rateable, List<Rating>> userRatings = ratings.get(student);
        List<Rating> subjectRatings = null;
View Full Code Here

Examples of service.exception.NotAllowedException

            scores.put(scoredUser, userScore);
        }
        //check if the scorer is allowed to score the user
        if (User.ADMIN != scorer && !subject.getScorers().contains(scorer)) {
            //if not throw an exception
            throw new NotAllowedException(scorer + " can't score for this subject!");
        }

        //get the score for the specified subject
        List<Score> subjectScores = userScore.get(subject);
        //check if the score for the subject is not empty
View Full Code Here

Examples of service.exception.NotAllowedException

     *                             to score a student.
     */
    public Map<Scoreable, List<Score>> getScores(User requester, Student student) throws NotAllowedException {
        //check for the permission of the requester, so that not anyone can retrieve the scores for any student
        if (!requester.equals(student) && requester != User.ADMIN) {
            throw new NotAllowedException(requester + " is not allowed to retrieve the scores for " + student);
        }

        Map<Scoreable, List<Score>> userScore = scores.get(student);
        //for an empty userScore create a new Empty (Hash)Map
        if (userScore == null) {
View Full Code Here

Examples of service.exception.NotAllowedException

     *                             to score a student.
     */
    public List<Score> getScores(User requester, Scoreable subject, Student student) throws NotAllowedException {
        //check for the permission of the requester, so that not anyone can retrieve the scores for any subject/student
        if (!requester.equals(student) && !subject.getScorers().contains(requester) && requester != User.ADMIN) {
            throw new NotAllowedException(requester + " is not allowed to retrieve the scores for " + student);
        }

        Map<Scoreable, List<Score>> userScore = scores.get(student);
        List<Score> score = null;

View Full Code Here

Examples of service.exception.NotAllowedException

                if (userScores != null && !userScores.isEmpty()) {
                    List<Score> subjectScores = userScores.get(appointment);
                   
                    if (subjectScores != null && subjectScores.size() + 1 > appointment.getMaxTries()) {
                        throw new NotAllowedException();
                    }
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.