Project

General

Profile

« Previous | Next » 

Revision 61366

fixed method deleting repository admin by email

View differences:

modules/uoa-repository-manager-service/branches/aai_roles_new/src/main/java/eu/dnetlib/repo/manager/controllers/RepositoryController.java
282 282
    /**
283 283
     * Unsubscribe from repo by email
284 284
     */
285
    @RequestMapping(method = RequestMethod.DELETE, path = "{id}/admins/{email}")
285
    @RequestMapping(method = RequestMethod.DELETE, path = "{id}/admins/{email:.+}")
286 286
    @PreAuthorize("hasAnyAuthority('ROLE_ADMIN', 'ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#id)")
287
    public Response unsubscribeByEmail(@PathVariable("id") String id, @PathVariable("email") String email) throws ResourceNotFoundException {
287
    public ResponseEntity<Void> unsubscribeByEmail(@PathVariable("id") String id, @PathVariable("email") String email) throws ResourceNotFoundException {
288 288
        authorizationService.removeAdmin(id, email);
289
        return Response.status(HttpStatus.OK.value()).entity(JsonUtils.createResponse("Role has been removed").toString()).type(javax.ws.rs.core.MediaType.APPLICATION_JSON).build();
289
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
290 290
    }
291 291
}

Also available in: Unified diff