Exemplo n.º 1
0
 @PUT
 @Produces("application/json")
 @Path("/edit")
 public String editUser(String userToEdit)
     throws PreexistingEntityException, NonexistentEntityException {
   String user = securityContext.getUserPrincipal().getName();
   return jsonAssembler.editUser(userToEdit, user);
 }
Exemplo n.º 2
0
 @PUT
 @Produces("application/json")
 @Path("/changePassword")
 public String changePassword(String passwordInfo)
     throws PreexistingEntityException, NonexistentEntityException {
   String user = securityContext.getUserPrincipal().getName();
   return jsonAssembler.editPassword(passwordInfo, user);
 }
Exemplo n.º 3
0
 @Path("myStudyPoints/{classId}")
 @GET
 @Produces("application/json")
 public Response studypointsForStudentClass(@PathParam("classId") String classId) {
   String user = securityContext.getUserPrincipal().getName();
   return Response.status(200)
       .header("Access-Control-Allow-Origin", "*")
       .entity(jsonAssembler.getStudyPointsForCurrentUser(classId, user))
       .build();
 }
Exemplo n.º 4
0
 @GET
 @Produces("application/json")
 public String getClassesForCurrentUser() {
   String user = securityContext.getUserPrincipal().getName();
   return jsonAssembler.getUser(user);
 }