Revision 61692
Added by Antonis Lempesis over 2 years ago
RepositoryController.java | ||
---|---|---|
169 | 169 |
} |
170 | 170 |
|
171 | 171 |
@RequestMapping(value = "/deleteInterface/", method = RequestMethod.DELETE) |
172 |
@PreAuthorize("@authorizationService.isMemberOf(#id)") |
|
172 |
@PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or @authorizationService.isMemberOf(#id)")
|
|
173 | 173 |
public void deleteRepositoryInterface(@RequestParam("id") String id, |
174 | 174 |
@RequestParam("registeredBy") String registeredBy) { |
175 | 175 |
repositoryService.deleteRepositoryInterface(id, registeredBy); |
... | ... | |
187 | 187 |
return repositoryService.addRepositoryInterface(datatype, id, registeredBy, comment, repositoryInterface); |
188 | 188 |
} |
189 | 189 |
|
190 |
@RequestMapping(value = "/updateRepositoryInterface", method = RequestMethod.POST, |
|
191 |
consumes = MediaType.APPLICATION_JSON_VALUE) |
|
192 |
@ResponseBody |
|
193 |
@PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or @authorizationService.isMemberOf(#id)") |
|
194 |
public RepositoryInterface updateRepositoryInterface(@RequestParam("repoId") String id, |
|
195 |
@RequestParam("registeredBy") String registeredBy, |
|
196 |
@RequestParam(value = "comment", required = false) String comment, |
|
197 |
@RequestBody RepositoryInterface repositoryInterface) throws Exception { |
|
198 |
return repositoryService.updateRepositoryInterface(id, registeredBy, comment, repositoryInterface); |
|
199 |
} |
|
200 |
|
|
190 | 201 |
@RequestMapping(value = "/getUrlsOfUserRepos/{page}/{size}/", method = RequestMethod.GET, |
191 | 202 |
produces = MediaType.APPLICATION_JSON_VALUE) |
192 | 203 |
@ResponseBody |
... | ... | |
231 | 242 |
return repositoryService.getListLatestUpdate(mode); |
232 | 243 |
} |
233 | 244 |
|
234 |
@RequestMapping(value = "/updateRepositoryInterface", method = RequestMethod.POST, |
|
235 |
consumes = MediaType.APPLICATION_JSON_VALUE) |
|
236 |
@ResponseBody |
|
237 |
@PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or @authorizationService.isMemberOf(#id)") |
|
238 |
public RepositoryInterface updateRepositoryInterface(@RequestParam("repoId") String id, |
|
239 |
@RequestParam("registeredBy") String registeredBy, |
|
240 |
@RequestParam(value = "comment", required = false) String comment, |
|
241 |
@RequestBody RepositoryInterface repositoryInterface) throws Exception { |
|
242 |
return repositoryService.updateRepositoryInterface(id, registeredBy, comment, repositoryInterface); |
|
243 |
} |
|
244 |
|
|
245 |
|
|
246 | 245 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////// |
247 | 246 |
/////////////////////////////////////////////////////////////////////////////////////////////////////////// |
248 | 247 |
|
Also available in: Unified diff
fixed authorization for deleteInterface