Package edu.wpi.cs.wpisuitetng.exceptions

Examples of edu.wpi.cs.wpisuitetng.exceptions.UnauthorizedException


          s = sessions.getSession(c.getValue())
      }
     
      if(s == null)
      {
        throw new UnauthorizedException();
      }
    }
    else
    {
      throw new AuthenticationException("Could not find WPISuite cookie. Please Login to recieve one.");
View Full Code Here


  }

  private void ensureRole(Session session, Role role) throws WPISuiteException {
    User user = (User) db.retrieve(User.class, "username", session.getUsername()).get(0);
    if(!user.getRole().equals(role)) {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

     
      return (m != null) ? true : false;
    }
    else{
      logger.log(Level.WARNING, "ProjectManager Delete attempted by user with insufficient permission");
      throw new UnauthorizedException("You do not have the required permissions to perform this action.");
    }
  }
View Full Code Here

    data.deleteAll(new Project("",""));
    }
    else
    {
      logger.log(Level.WARNING, "ProjectManager DeleteAll attempted by user with insufficient permission");
      throw new UnauthorizedException("You do not have the required permissions to perform this action.");
    }
  }
View Full Code Here

      return toUpdate;
    }
    else
    {
      logger.log(Level.WARNING, "Unauthorized Project update attempted.");
      throw new UnauthorizedException("You do not have the required permissions to perform this action.");
    }
  }
View Full Code Here

      return (m != null) ? true : false;
    }
    else
    {
      logger.log(Level.WARNING,"User: "+s1.getUser().getUsername()+"attempted to delete: "+id);
      throw new UnauthorizedException("Delete not authorized");
    }
   
   
   
   
View Full Code Here

      this.save(s, toUpdate);
    }
    else
    {
      logger.log(Level.WARNING, "Access denied to user: "+s.getUser().getUsername());
      throw new UnauthorizedException("Users accessible only by Admins and themselves");
    }
    return toUpdate;
  }
View Full Code Here

TOP

Related Classes of edu.wpi.cs.wpisuitetng.exceptions.UnauthorizedException

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.