~stian-sandvold/dhis2/AnalyticsByUser

« back to all changes in this revision

Viewing changes to dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AppController.java

  • Committer: Stian Sandvold
  • Date: 2016-08-03 09:05:19 UTC
  • mfrom: (23568.1.32 dhis2)
  • Revision ID: stian.sandvold@gmail.com-20160803090519-sw34m18dzycv2amz
merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
    }
135
135
 
136
136
    @RequestMapping( method = RequestMethod.POST )
 
137
    @PreAuthorize( "hasRole('ALL') or hasRole('M_dhis-web-maintenance-appmanager')" )
137
138
    @ResponseStatus( HttpStatus.NO_CONTENT )
138
 
    @PreAuthorize( "hasRole('ALL') or hasRole('M_dhis-web-maintenance-appmanager')" )
139
139
    public void installApp( @RequestParam( "file" ) MultipartFile file )
140
140
        throws IOException, WebMessageException
141
141
    {
153
153
    }
154
154
 
155
155
    @RequestMapping( method = RequestMethod.PUT )
 
156
    @PreAuthorize( "hasRole('ALL') or hasRole('M_dhis-web-maintenance-appmanager')" )
156
157
    @ResponseStatus( HttpStatus.NO_CONTENT )
157
 
    @PreAuthorize( "hasRole('ALL') or hasRole('M_dhis-web-maintenance-appmanager')" )
158
158
    public void reloadApps()
159
159
    {
160
160
        appManager.reloadApps();
178
178
            return;
179
179
        }
180
180
 
181
 
        ObjectMapper jsonMapper = ((DefaultRenderService) renderService).getJsonMapper();
 
181
        ObjectMapper jsonMapper = DefaultRenderService.getJsonMapper();
182
182
        App application = jsonMapper.readValue( manifest.getInputStream(), App.class );
183
183
 
184
184
        if ( application.getName() == null || !appManager.isAccessible( application ) )
229
229
 
230
230
    @RequestMapping( value = "/{app}", method = RequestMethod.DELETE )
231
231
    @PreAuthorize( "hasRole('ALL') or hasRole('M_dhis-web-maintenance-appmanager')" )
 
232
    @ResponseStatus( HttpStatus.NO_CONTENT )
232
233
    public void deleteApp( @PathVariable( "app" ) String app, @RequestParam( required = false ) boolean deleteAppData )
233
234
        throws WebMessageException
234
235
    {
246
247
    @SuppressWarnings( "unchecked" )
247
248
    @RequestMapping( value = "/config", method = RequestMethod.POST, consumes = ContextUtils.CONTENT_TYPE_JSON )
248
249
    @PreAuthorize( "hasRole('ALL') or hasRole('M_dhis-web-maintenance-appmanager')" )
 
250
    @ResponseStatus( HttpStatus.NO_CONTENT )
249
251
    public void setConfig( HttpServletRequest request )
250
252
        throws IOException, WebMessageException
251
253
    {