Project

General

Profile

« Previous | Next » 

Revision 57966

Clearing unnecessary "user" variables

View differences:

BrokerController.java
31 31
            produces = MediaType.APPLICATION_JSON_VALUE)
32 32
    @ResponseBody
33 33
    @PreAuthorize("hasRole('ROLE_USER')")
34
    public DatasourcesBroker getDatasourcesOfUser(@RequestParam("user")
35
                                           @ApiParam(value = "User email", required = true) String user,
34
    public DatasourcesBroker getDatasourcesOfUser(
36 35
                                           @RequestParam("includeShared")
37 36
                                           @ApiParam(value = "Include shared datasources", required = true , defaultValue = "false") String includeShared,
38 37
                                           @RequestParam("includeByOthers")
39 38
                                           @ApiParam(value = "Include datasources of other", required = true,defaultValue = "false") String includeByOthers) throws JSONException {
40
        user = ((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail();
41
        return brokerService.getDatasourcesOfUser(user, includeShared, includeByOthers);
39
        return brokerService.getDatasourcesOfUser(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), includeShared, includeByOthers);
42 40
    }
43 41

  
44 42
    @RequestMapping(value = "/getTopicsForDatasource/{datasourceName:.+}" ,
......
72 70
        return brokerService.showEvents(datasourceName, topic, page, size);
73 71
    }
74 72

  
75
    @RequestMapping(value = "/getSimpleSubscriptionsOfUser/{userEmail}" ,
73
    @RequestMapping(value = "/getSimpleSubscriptionsOfUser" ,
76 74
            method = RequestMethod.GET,
77 75
            produces = MediaType.APPLICATION_JSON_VALUE)
78 76
    @ResponseBody
79 77
    @PreAuthorize("hasRole('ROLE_USER')")
80
    public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(@PathVariable("userEmail")  String userEmail) throws BrokerException{
81
        userEmail = ((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail();
82
        return brokerService.getSimpleSubscriptionsOfUser(userEmail);
78
    public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser() throws BrokerException{
79
        return brokerService.getSimpleSubscriptionsOfUser(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail());
83 80
    }
84 81

  
85 82
    @RequestMapping(value = "/subscribe" , method = RequestMethod.POST,

Also available in: Unified diff