use of org.hisp.dhis.user.Users in project dhis2-core by dhis2.
the class UserController method postXmlInvites.
@RequestMapping(value = BULK_INVITE_PATH, method = RequestMethod.POST, consumes = { "application/xml", "text/xml" })
@ResponseStatus(HttpStatus.NO_CONTENT)
public void postXmlInvites(HttpServletRequest request, HttpServletResponse response) throws Exception {
Users users = renderService.fromXml(request.getInputStream(), Users.class);
User currentUser = currentUserService.getCurrentUser();
for (User user : users.getUsers()) {
if (!validateInviteUser(user, currentUser)) {
return;
}
}
for (User user : users.getUsers()) {
inviteUser(user, currentUser, request);
}
}
use of org.hisp.dhis.user.Users in project dhis2-core by dhis2.
the class UserController method postJsonInvites.
@RequestMapping(value = BULK_INVITE_PATH, method = RequestMethod.POST, consumes = "application/json")
@ResponseStatus(HttpStatus.NO_CONTENT)
public void postJsonInvites(HttpServletRequest request, HttpServletResponse response) throws Exception {
Users users = renderService.fromJson(request.getInputStream(), Users.class);
User currentUser = currentUserService.getCurrentUser();
for (User user : users.getUsers()) {
if (!validateInviteUser(user, currentUser)) {
return;
}
}
for (User user : users.getUsers()) {
inviteUser(user, currentUser, request);
}
}
Aggregations