Project

General

Profile

« Previous | Next » 

Revision 61441

merged branch aai_roles_new to trunk

View differences:

PiWikServiceImpl.java
75 75
    }
76 76

  
77 77
    @Override
78
    @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
78
    @PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or (hasAuthority('REGISTERED_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
79 79
    public PiwikInfo savePiwikInfo(PiwikInfo piwikInfo) {
80 80
        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
81 81
        jdbcTemplate.update(INSERT_PIWIK_INFO, new Object[]{piwikInfo.getRepositoryId(), piwikInfo.getSiteId(), piwikInfo.getRequestorName(),
......
144 144
    }
145 145

  
146 146
    @Override
147
    @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
147
    @PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR')")
148 148
    public ResponseEntity<Object> approvePiwikSite(String repositoryId) {
149 149
        new JdbcTemplate(dataSource).update(APPROVE_PIWIK_SITE, new Object[] {repositoryId}, new int[] {Types.VARCHAR});
150 150
        return new ResponseEntity<>("OK",HttpStatus.OK);
......
158 158
    }
159 159

  
160 160
    @Override
161
    @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN')")
161
    @PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR')")
162 162
    public ResponseEntity<Object> markPiwikSiteAsValidated(String repositoryId) throws RepositoryServiceException {
163 163
        try {
164 164
            approvePiwikSite(repositoryId);
......
179 179
    }
180 180

  
181 181
    @Override
182
    @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_PROVIDE_ADMIN') or (hasRole('ROLE_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
182
    @PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or (hasAuthority('REGISTERED_USER') and #piwikInfo.requestorEmail == authentication.userInfo.email)")
183 183
    public PiwikInfo enableMetricsForRepository(String officialName,
184 184
                                                String repoWebsite,
185 185
                                                PiwikInfo piwikInfo) throws RepositoryServiceException {

Also available in: Unified diff