Merge pull request 'merge master to develop' (#9) from master into develop

Reviewed-on: #9
This commit is contained in:
Lampros Smyrnaios 2023-11-02 14:16:54 +01:00
commit 224d058d89
1 changed files with 10 additions and 0 deletions

View File

@ -39,6 +39,16 @@ public class PiWikController {
@Autowired @Autowired
private PiWikServiceImpl piWikService; private PiWikServiceImpl piWikService;
@RequestMapping(value = "/validated", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public Boolean isPiwikValidated(@RequestParam("repositoryId") String repositoryId) {
PiwikInfo info = piWikService.getPiwikSiteForRepo(repositoryId);
if (info != null) {
return info.isValidated();
}
return false;
}
@RequestMapping(value = "/getPiwikSiteForRepo/{repositoryId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/getPiwikSiteForRepo/{repositoryId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody @ResponseBody
@PreAuthorize("hasAnyAuthority('SUPER_ADMINISTRATOR', 'CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or @authorizationService.isMemberOf(#repositoryId) or (@repositoryService.getRepositoryById(#repositoryId).registeredby==null and hasAuthority('REGISTERED_USER'))") @PreAuthorize("hasAnyAuthority('SUPER_ADMINISTRATOR', 'CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or @authorizationService.isMemberOf(#repositoryId) or (@repositoryService.getRepositoryById(#repositoryId).registeredby==null and hasAuthority('REGISTERED_USER'))")