Revision 51656
Added by Panagiotis Kanakakis about 6 years ago
BrokerApiImpl.java | ||
---|---|---|
18 | 18 |
import org.springframework.http.HttpMethod; |
19 | 19 |
import org.springframework.http.ResponseEntity; |
20 | 20 |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; |
21 |
import org.springframework.security.access.prepost.PreAuthorize; |
|
21 | 22 |
import org.springframework.stereotype.Component; |
22 | 23 |
import org.springframework.util.LinkedMultiValueMap; |
23 | 24 |
import org.springframework.util.MultiValueMap; |
... | ... | |
86 | 87 |
|
87 | 88 |
|
88 | 89 |
@Override |
90 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
89 | 91 |
public DatasourcesBroker getDatasourcesOfUser(@RequestParam("user") |
90 | 92 |
@ApiParam(value = "User email", required = true) String user, |
91 | 93 |
@RequestParam("includeShared") |
... | ... | |
135 | 137 |
} |
136 | 138 |
|
137 | 139 |
@Override |
140 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
138 | 141 |
public EventsPage advancedShowEvents(@PathVariable("page") String page, |
139 | 142 |
@PathVariable("size") String size, |
140 | 143 |
@RequestBody AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException { |
... | ... | |
216 | 219 |
} |
217 | 220 |
|
218 | 221 |
@Override |
222 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
219 | 223 |
public EventsPage showEvents(@RequestParam("datasourceName") String datasourceName, |
220 | 224 |
@RequestParam("topic") String topic, |
221 | 225 |
@RequestParam("page") String page, |
... | ... | |
243 | 247 |
} |
244 | 248 |
|
245 | 249 |
@Override |
250 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
246 | 251 |
public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(@PathVariable("userEmail") String userEmail) |
247 | 252 |
throws BrokerException { |
248 | 253 |
|
... | ... | |
268 | 273 |
} |
269 | 274 |
|
270 | 275 |
@Override |
276 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
271 | 277 |
public Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException { |
272 | 278 |
final String service = "/subscribe"; |
273 | 279 |
|
... | ... | |
296 | 302 |
} |
297 | 303 |
|
298 | 304 |
@Override |
305 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
299 | 306 |
public void unsubscribe(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException { |
300 | 307 |
final String service = "/subscriptions/" + subscriptionId; |
301 | 308 |
|
... | ... | |
316 | 323 |
} |
317 | 324 |
|
318 | 325 |
@Override |
326 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
319 | 327 |
public Subscription getSubscription(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException { |
320 | 328 |
final String service = "/subscriptions/" + subscriptionId; |
321 | 329 |
|
... | ... | |
343 | 351 |
} |
344 | 352 |
|
345 | 353 |
@Override |
354 |
@PreAuthorize("hasRole('ROLE_USER')") |
|
346 | 355 |
public EventsPage getNotificationsBySubscriptionId(@PathVariable("subscriptionId") String subscriptionId, |
347 | 356 |
@PathVariable("page") String page, |
348 | 357 |
@PathVariable("size") String size |
Also available in: Unified diff
Add PreAuthorize annotation on user methods.