Revision 56636
Added by Antonis Lempesis almost 5 years ago
PiWikServiceImpl.java | ||
---|---|---|
72 | 72 |
} |
73 | 73 |
|
74 | 74 |
@Override |
75 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
|
75 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
|
76 | 76 |
public PiwikInfo savePiwikInfo(@RequestBody PiwikInfo piwikInfo) { |
77 | 77 |
JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); |
78 | 78 |
jdbcTemplate.update(INSERT_PIWIK_INFO, new Object[]{piwikInfo.getRepositoryId(), piwikInfo.getSiteId(), piwikInfo.getRequestorName(), |
... | ... | |
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
@Override |
96 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN')")
|
|
96 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
|
|
97 | 97 |
public ResponseEntity<Object> approvePiwikSite(@PathVariable("repositoryId") String repositoryId) { |
98 | 98 |
new JdbcTemplate(dataSource).update(APPROVE_PIWIK_SITE, new Object[] {repositoryId}, new int[] {Types.VARCHAR}); |
99 | 99 |
return new ResponseEntity<>("OK",HttpStatus.OK); |
... | ... | |
107 | 107 |
} |
108 | 108 |
|
109 | 109 |
@Override |
110 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN')")
|
|
110 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
|
|
111 | 111 |
public ResponseEntity<Object> markPiwikSiteAsValidated(@PathVariable("repositoryId") String repositoryId) throws RepositoryServiceException { |
112 | 112 |
try { |
113 | 113 |
approvePiwikSite(repositoryId); |
... | ... | |
128 | 128 |
} |
129 | 129 |
|
130 | 130 |
@Override |
131 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PORTAL_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
|
131 |
@PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
|
|
132 | 132 |
public PiwikInfo enableMetricsForRepository(@RequestParam("officialName") String officialName, |
133 | 133 |
@RequestParam("repoWebsite") String repoWebsite, |
134 | 134 |
@RequestBody PiwikInfo piwikInfo) throws RepositoryServiceException { |
Also available in: Unified diff
Merged dev-api branch to trunk. merge -r54925:HEAD https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/uoa-repository-manager-service/branches/dev-api