@Secured(value = {"ROLE_ADMIN", "ROLE_MANAGER", "ROLE_USER"})
 @RequestMapping(method = RequestMethod.GET, value = "user-by-topics")
 public @ResponseBody ResponseEntity<List<UserDto>> getUserByTopics() {
   List<PipUser> user = PipUser.findAllPipUsers();
   List<UserDto> userDtos = DtoCastUtil.castUser(user);
   return new ResponseEntity<List<UserDto>>(userDtos, HttpStatus.OK);
 }
 @Secured(value = {"ROLE_ADMIN", "ROLE_MANAGER", "ROLE_USER"})
 @RequestMapping(method = RequestMethod.GET, value = "organizations")
 public @ResponseBody ResponseEntity<Set<OrganisazionDto>> getOrganisations() {
   List<Organisazion> organisazions = Organisazion.findAllOrganisazions("name", "ASC");
   Set<OrganisazionDto> dtos = DtoCastUtil.castOrgs(organisazions);
   return new ResponseEntity<Set<OrganisazionDto>>(dtos, HttpStatus.OK);
 }
 @Secured(value = {"ROLE_ADMIN", "ROLE_USER", "ROLE_MANAGER"})
 @RequestMapping(method = RequestMethod.GET)
 public @ResponseBody ResponseEntity<UserDto> getUser(
     Principal principal, @RequestParam(value = "uuid", required = false) String uuid) {
   PipUser user;
   if (uuid != null) user = PipUser.findPipUsersByUuidEquals(uuid).getSingleResult();
   else user = PipUser.findPipUsersByEmailEquals(principal.getName()).getSingleResult();
   UserDto dto = DtoCastUtil.cast(user);
   return new ResponseEntity<UserDto>(dto, HttpStatus.OK);
 }
  @Secured(value = {"ROLE_ADMIN", "ROLE_MANAGER", "ROLE_MANAGER"})
  @RequestMapping(method = RequestMethod.GET, value = "list")
  public @ResponseBody ResponseEntity<List<UserDto>> getUsers(Principal principal) {
    PipUser prince = PipUser.findPipUsersByEmailEquals(principal.getName()).getSingleResult();

    List<UserDto> list = new ArrayList<UserDto>();
    List<PipUser> users;
    if (PipRole.ADMIN.getName().equals(prince.getRole()))
      users = PipUser.findAllPipUsers("name", "asc");
    else {
      users =
          PipUser.findPipUserByOrganisazionAndRole(
              prince.getOrganisazions().get(0), PipRole.USER.getName());
    }
    list = DtoCastUtil.castUser(users);
    return new ResponseEntity<List<UserDto>>(list, HttpStatus.OK);
  }