changed repoId to id
This commit is contained in:
parent
e0c193f86b
commit
301e680136
|
@ -192,13 +192,13 @@ public class RepositoryController {
|
|||
@RequestMapping(value = "/addInterface", method = RequestMethod.POST,
|
||||
consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#repoId)")
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#id)")
|
||||
public RepositoryInterface addRepositoryInterface(@RequestParam("datatype") String datatype,
|
||||
@RequestParam("repoId") String repoId,
|
||||
@RequestParam("id") String id,
|
||||
@RequestParam("registeredBy") String registeredBy,
|
||||
@RequestParam(value = "comment", required = false) String comment,
|
||||
@RequestBody RepositoryInterface repositoryInterface) throws Exception {
|
||||
return repositoryService.addRepositoryInterface(datatype, repoId, registeredBy, comment, repositoryInterface);
|
||||
return repositoryService.addRepositoryInterface(datatype, id, registeredBy, comment, repositoryInterface);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getUrlsOfUserRepos/{page}/{size}/", method = RequestMethod.GET,
|
||||
|
@ -231,11 +231,11 @@ public class RepositoryController {
|
|||
return repositoryService.getDatasourceClasses(mode);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getMetricsInfoForRepository/{repoId}", method = RequestMethod.GET,
|
||||
@RequestMapping(value = "/getMetricsInfoForRepository/{id}", method = RequestMethod.GET,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public MetricsInfo getMetricsInfoForRepository(@PathVariable("repoId") String repoId) throws RepositoryServiceException {
|
||||
return repositoryService.getMetricsInfoForRepository(repoId);
|
||||
public MetricsInfo getMetricsInfoForRepository(@PathVariable("id") String id) throws RepositoryServiceException {
|
||||
return repositoryService.getMetricsInfoForRepository(id);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getListLatestUpdate/{mode}", method = RequestMethod.GET,
|
||||
|
@ -248,12 +248,12 @@ public class RepositoryController {
|
|||
@RequestMapping(value = "/updateRepositoryInterface", method = RequestMethod.POST,
|
||||
consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#repoId)")
|
||||
public RepositoryInterface updateRepositoryInterface(@RequestParam("repoId") String repoId,
|
||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#id)")
|
||||
public RepositoryInterface updateRepositoryInterface(@RequestParam("id") String id,
|
||||
@RequestParam("registeredBy") String registeredBy,
|
||||
@RequestParam(value = "comment", required = false) String comment,
|
||||
@RequestBody RepositoryInterface repositoryInterface) throws Exception {
|
||||
return repositoryService.updateRepositoryInterface(repoId, registeredBy, comment, repositoryInterface);
|
||||
return repositoryService.updateRepositoryInterface(id, registeredBy, comment, repositoryInterface);
|
||||
}
|
||||
|
||||
|
||||
|
@ -263,18 +263,18 @@ public class RepositoryController {
|
|||
/**
|
||||
* Get all the admins of the repository
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.GET, path = "{repoId}/admins")
|
||||
@RequestMapping(method = RequestMethod.GET, path = "{id}/admins")
|
||||
@PreAuthorize("hasAnyAuthority('ROLE_ADMIN', 'ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#id)")
|
||||
public ResponseEntity<List<User>> getAdminsOfARepo(@PathVariable("repoId") String id) {
|
||||
public ResponseEntity<List<User>> getAdminsOfARepo(@PathVariable("id") String id) {
|
||||
return new ResponseEntity<>(authorizationService.getAdminsOfRepo(id), HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to repo by email
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.POST, path = "{repoId}/admins")
|
||||
@RequestMapping(method = RequestMethod.POST, path = "{id}/admins")
|
||||
@PreAuthorize("hasAnyAuthority('ROLE_ADMIN', 'ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#id)")
|
||||
public Response subscribeByEmail(@PathVariable("repoId") String id, @RequestBody String email) throws ResourceNotFoundException {
|
||||
public Response subscribeByEmail(@PathVariable("id") String id, @RequestBody String email) throws ResourceNotFoundException {
|
||||
authorizationService.addAdmin(id, email);
|
||||
return Response.status(HttpStatus.OK.value()).entity(JsonUtils.createResponse("Role has been assigned").toString()).type(javax.ws.rs.core.MediaType.APPLICATION_JSON).build();
|
||||
}
|
||||
|
@ -282,9 +282,9 @@ public class RepositoryController {
|
|||
/**
|
||||
* Unsubscribe from repo by email
|
||||
*/
|
||||
@RequestMapping(method = RequestMethod.DELETE, path = "{repoId}/admins/{email}")
|
||||
@RequestMapping(method = RequestMethod.DELETE, path = "{id}/admins/{email}")
|
||||
@PreAuthorize("hasAnyAuthority('ROLE_ADMIN', 'ROLE_PROVIDE_ADMIN') or @authorizationService.isMemberOf(#id)")
|
||||
public Response unsubscribeByEmail(@PathVariable("id") String id, @RequestBody String email) throws ResourceNotFoundException {
|
||||
public Response unsubscribeByEmail(@PathVariable("id") String id, @PathVariable("email") String email) throws ResourceNotFoundException {
|
||||
authorizationService.removeAdmin(id, email);
|
||||
return Response.status(HttpStatus.OK.value()).entity(JsonUtils.createResponse("Role has been removed").toString()).type(javax.ws.rs.core.MediaType.APPLICATION_JSON).build();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue