class RoleController {

	@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_DEVICE_MANAGER') or hasRole('ROLE_DRPROGRAM') or hasRole('ROLE_VTN') or hasRole('ROLE_XMPP')")
	@RequestMapping(value = "/{username}", method = RequestMethod.POST)
	@ResponseBody
	public List<String> getUserRole(@PathVariable("username") String username, HttpServletResponse response) {
		AbstractUser user = abstractUserDao.findOneByUsername(username);
		List<String> roles = new ArrayList<>();
		if (user == null) {
			response.setStatus(HttpStatus.NOT_FOUND_404);
			return roles;
		}
		roles = user.getRoles();

		if (user instanceof Ven) {
			roles.add("ROLE_VEN");
		} else if (user instanceof OadrUser) {
			roles.add("ROLE_USER");
		} else if (user instanceof OadrApp) {
			roles.add("ROLE_APP");
		}

		LOGGER.info(user.toString() + " roles: " + roles.toString());

		return roles;
	}

}