- Renaming role PORTAL_PROVIDE_ADMIN to ROLE_PROVIDE_ADMIN
- Renaming the @PreAuthorize role names
This commit is contained in:
parent
70f25060d5
commit
37f4dc005b
|
@ -28,7 +28,7 @@ public class PiWikController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/savePiwikInfo" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
@RequestMapping(value = "/savePiwikInfo" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN') or (hasRole('ROLE_USER') " +
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') " +
|
||||||
"and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
"and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
||||||
public PiwikInfo savePiwikInfo(@RequestBody PiwikInfo piwikInfo) {
|
public PiwikInfo savePiwikInfo(@RequestBody PiwikInfo piwikInfo) {
|
||||||
return piWikService.savePiwikInfo(piwikInfo);
|
return piWikService.savePiwikInfo(piwikInfo);
|
||||||
|
@ -41,7 +41,7 @@ public class PiWikController {
|
||||||
|
|
||||||
@RequestMapping(value = "/approvePiwikSite/{repositoryId}" , method = RequestMethod.GET)
|
@RequestMapping(value = "/approvePiwikSite/{repositoryId}" , method = RequestMethod.GET)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN')")
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
|
||||||
public ResponseEntity<Object> approvePiwikSite(@PathVariable("repositoryId") String repositoryId) {
|
public ResponseEntity<Object> approvePiwikSite(@PathVariable("repositoryId") String repositoryId) {
|
||||||
return piWikService.approvePiwikSite(repositoryId);
|
return piWikService.approvePiwikSite(repositoryId);
|
||||||
}
|
}
|
||||||
|
@ -55,14 +55,14 @@ public class PiWikController {
|
||||||
@RequestMapping(value = "/markPiwikSiteAsValidated/{repositoryId}" , method = RequestMethod.POST,
|
@RequestMapping(value = "/markPiwikSiteAsValidated/{repositoryId}" , method = RequestMethod.POST,
|
||||||
consumes = MediaType.APPLICATION_JSON_VALUE)
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN')")
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
|
||||||
public ResponseEntity<Object> markPiwikSiteAsValidated(@PathVariable("repositoryId") String repositoryId) throws RepositoryServiceException {
|
public ResponseEntity<Object> markPiwikSiteAsValidated(@PathVariable("repositoryId") String repositoryId) throws RepositoryServiceException {
|
||||||
return piWikService.markPiwikSiteAsValidated(repositoryId);
|
return piWikService.markPiwikSiteAsValidated(repositoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/enableMetricsForRepository", method = RequestMethod.POST,
|
@RequestMapping(value = "/enableMetricsForRepository", method = RequestMethod.POST,
|
||||||
consumes = MediaType.APPLICATION_JSON_VALUE)
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
||||||
public PiwikInfo enableMetricsForRepository(@RequestParam("officialName") String officialName,
|
public PiwikInfo enableMetricsForRepository(@RequestParam("officialName") String officialName,
|
||||||
@RequestParam("repoWebsite") String repoWebsite,
|
@RequestParam("repoWebsite") String repoWebsite,
|
||||||
@RequestBody PiwikInfo piwikInfo) throws RepositoryServiceException {
|
@RequestBody PiwikInfo piwikInfo) throws RepositoryServiceException {
|
||||||
|
|
|
@ -72,7 +72,7 @@ public class PiWikServiceImpl implements PiWikService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
||||||
public PiwikInfo savePiwikInfo(@RequestBody PiwikInfo piwikInfo) {
|
public PiwikInfo savePiwikInfo(@RequestBody PiwikInfo piwikInfo) {
|
||||||
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
|
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
|
||||||
jdbcTemplate.update(INSERT_PIWIK_INFO, new Object[]{piwikInfo.getRepositoryId(), piwikInfo.getSiteId(), piwikInfo.getRequestorName(),
|
jdbcTemplate.update(INSERT_PIWIK_INFO, new Object[]{piwikInfo.getRepositoryId(), piwikInfo.getSiteId(), piwikInfo.getRequestorName(),
|
||||||
|
@ -93,7 +93,7 @@ public class PiWikServiceImpl implements PiWikService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN')")
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
|
||||||
public ResponseEntity<Object> approvePiwikSite(@PathVariable("repositoryId") String repositoryId) {
|
public ResponseEntity<Object> approvePiwikSite(@PathVariable("repositoryId") String repositoryId) {
|
||||||
new JdbcTemplate(dataSource).update(APPROVE_PIWIK_SITE, new Object[] {repositoryId}, new int[] {Types.VARCHAR});
|
new JdbcTemplate(dataSource).update(APPROVE_PIWIK_SITE, new Object[] {repositoryId}, new int[] {Types.VARCHAR});
|
||||||
return new ResponseEntity<>("OK",HttpStatus.OK);
|
return new ResponseEntity<>("OK",HttpStatus.OK);
|
||||||
|
@ -107,7 +107,7 @@ public class PiWikServiceImpl implements PiWikService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN')")
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
|
||||||
public ResponseEntity<Object> markPiwikSiteAsValidated(@PathVariable("repositoryId") String repositoryId) throws RepositoryServiceException {
|
public ResponseEntity<Object> markPiwikSiteAsValidated(@PathVariable("repositoryId") String repositoryId) throws RepositoryServiceException {
|
||||||
try {
|
try {
|
||||||
approvePiwikSite(repositoryId);
|
approvePiwikSite(repositoryId);
|
||||||
|
@ -128,7 +128,7 @@ public class PiWikServiceImpl implements PiWikService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
||||||
public PiwikInfo enableMetricsForRepository(@RequestParam("officialName") String officialName,
|
public PiwikInfo enableMetricsForRepository(@RequestParam("officialName") String officialName,
|
||||||
@RequestParam("repoWebsite") String repoWebsite,
|
@RequestParam("repoWebsite") String repoWebsite,
|
||||||
@RequestBody PiwikInfo piwikInfo) throws RepositoryServiceException {
|
@RequestBody PiwikInfo piwikInfo) throws RepositoryServiceException {
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
|
|
||||||
<util:map id="userRoles">
|
<util:map id="userRoles">
|
||||||
<entry key="urn:geant:openaire.eu:group:Super+Administrator#aai.openaire.eu" value="ROLE_ADMIN"/>
|
<entry key="urn:geant:openaire.eu:group:Super+Administrator#aai.openaire.eu" value="ROLE_ADMIN"/>
|
||||||
<entry key="urn:geant:openaire.eu:group:Content+Provider+Dashboard+Administrator#aai.openaire.eu" value="PORTAL_PROVIDE_ADMIN"/>
|
<entry key="urn:geant:openaire.eu:group:Content+Provider+Dashboard+Administrator#aai.openaire.eu" value="ROLE_PROVIDE_ADMIN"/>
|
||||||
</util:map>
|
</util:map>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue