Revision 61371
Added by Konstantinos Spyrou over 2 years ago
BrokerController.java | ||
---|---|---|
30 | 30 |
@RequestMapping(value = "/getDatasourcesOfUser" , method = RequestMethod.GET, |
31 | 31 |
produces = MediaType.APPLICATION_JSON_VALUE) |
32 | 32 |
@ResponseBody |
33 |
@PreAuthorize("hasRole('ROLE_USER')")
|
|
33 |
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
|
34 | 34 |
public DatasourcesBroker getDatasourcesOfUser( |
35 | 35 |
@RequestParam("includeShared") |
36 | 36 |
@ApiParam(value = "Include shared datasources", required = true , defaultValue = "false") String includeShared, |
... | ... | |
51 | 51 |
method = RequestMethod.POST, |
52 | 52 |
produces = MediaType.APPLICATION_JSON_VALUE) |
53 | 53 |
@ResponseBody |
54 |
@PreAuthorize("hasRole('ROLE_USER')")
|
|
54 |
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
|
55 | 55 |
public EventsPage advancedShowEvents(@PathVariable("page") String page, |
56 | 56 |
@PathVariable("size") String size, |
57 | 57 |
@RequestBody AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException{ |
... | ... | |
62 | 62 |
method = RequestMethod.GET, |
63 | 63 |
produces = MediaType.APPLICATION_JSON_VALUE) |
64 | 64 |
@ResponseBody |
65 |
@PreAuthorize("hasRole('ROLE_USER')")
|
|
65 |
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
|
66 | 66 |
public EventsPage showEvents(@RequestParam("datasourceName") String datasourceName, |
67 | 67 |
@RequestParam("topic") String topic, |
68 | 68 |
@RequestParam("page") String page, |
... | ... | |
74 | 74 |
method = RequestMethod.GET, |
75 | 75 |
produces = MediaType.APPLICATION_JSON_VALUE) |
76 | 76 |
@ResponseBody |
77 |
@PreAuthorize("hasRole('ROLE_USER')")
|
|
77 |
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
|
78 | 78 |
public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser() throws BrokerException{ |
79 | 79 |
return brokerService.getSimpleSubscriptionsOfUser(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail()); |
80 | 80 |
} |
... | ... | |
83 | 83 |
consumes = MediaType.APPLICATION_JSON_VALUE, |
84 | 84 |
produces = MediaType.APPLICATION_JSON_VALUE) |
85 | 85 |
@ResponseBody |
86 |
@PreAuthorize("hasRole('ROLE_USER') ")
|
|
86 |
@PreAuthorize("hasAuthority('REGISTERED_USER') ")
|
|
87 | 87 |
public Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException{ |
88 | 88 |
return brokerService.subscribe(obj); |
89 | 89 |
} |
... | ... | |
92 | 92 |
consumes = MediaType.APPLICATION_JSON_VALUE, |
93 | 93 |
produces = MediaType.APPLICATION_JSON_VALUE) |
94 | 94 |
@ResponseBody |
95 |
@PreAuthorize("hasRole('ROLE_USER')")
|
|
95 |
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
|
96 | 96 |
public ResponseEntity<Object> unsubscribe(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException{ |
97 | 97 |
return brokerService.unsubscribe(subscriptionId); |
98 | 98 |
} |
... | ... | |
100 | 100 |
@RequestMapping(value = "/getSubscription/{subscriptionId}" , method = RequestMethod.GET, |
101 | 101 |
produces = MediaType.APPLICATION_JSON_VALUE) |
102 | 102 |
@ResponseBody |
103 |
@PreAuthorize("hasRole('ROLE_USER')")
|
|
103 |
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
|
104 | 104 |
public Subscription getSubscription(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException{ |
105 | 105 |
return brokerService.getSubscription(subscriptionId); |
106 | 106 |
} |
... | ... | |
116 | 116 |
@RequestMapping(value = "/getNotificationsBySubscriptionId/{subscriptionId}/{page}/{size}" , method = RequestMethod.GET |
117 | 117 |
,produces = MediaType.APPLICATION_JSON_VALUE) |
118 | 118 |
@ResponseBody |
119 |
@PreAuthorize("hasRole('ROLE_USER')")
|
|
119 |
@PreAuthorize("hasAuthority('REGISTERED_USER')")
|
|
120 | 120 |
public EventsPage getNotificationsBySubscriptionId(@PathVariable("subscriptionId") String subscriptionId, |
121 | 121 |
@PathVariable("page") String page, |
122 | 122 |
@PathVariable("size") String size) throws BrokerException{ |
Also available in: Unified diff
1. changed user roles defined in the project to authorities given by the aai.
2. created method returning user roles with desired status (active, deleted).