~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/legend/LegendSetController.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:
37
37
import org.hisp.dhis.webapi.controller.AbstractCrudController;
38
38
import org.hisp.dhis.webapi.utils.WebMessageUtils;
39
39
import org.springframework.beans.factory.annotation.Autowired;
 
40
import org.springframework.http.HttpStatus;
40
41
import org.springframework.security.access.prepost.PreAuthorize;
41
42
import org.springframework.stereotype.Controller;
42
43
import org.springframework.web.bind.annotation.PathVariable;
43
44
import org.springframework.web.bind.annotation.RequestMapping;
44
45
import org.springframework.web.bind.annotation.RequestMethod;
 
46
import org.springframework.web.bind.annotation.ResponseStatus;
45
47
 
46
48
import javax.servlet.http.HttpServletRequest;
47
49
import javax.servlet.http.HttpServletResponse;
76
78
    @Override
77
79
    @RequestMapping( value = "/{uid}", method = RequestMethod.PUT, consumes = "application/json" )
78
80
    @PreAuthorize( "hasRole('F_GIS_ADMIN') or hasRole('F_LEGEND_SET_ADD') or hasRole('ALL')" )
 
81
    @ResponseStatus( HttpStatus.NO_CONTENT )
79
82
    public void putJsonObjectLegacy( ImportOptions importOptions, @PathVariable String uid, HttpServletRequest request, HttpServletResponse response ) throws Exception
80
83
    {
81
84
        LegendSet legendSet = legendService.getLegendSet( uid );
106
109
    @Override
107
110
    @RequestMapping( value = "/{uid}", method = RequestMethod.DELETE )
108
111
    @PreAuthorize( "hasRole('F_GIS_ADMIN') or hasRole('F_LEGEND_SET_DELETE')or hasRole('ALL')" )
 
112
    @ResponseStatus( HttpStatus.NO_CONTENT )
109
113
    public void deleteObject( @PathVariable String uid, HttpServletRequest request, HttpServletResponse response ) throws Exception
110
114
    {
111
115
        LegendSet legendSet = legendService.getLegendSet( uid );