1010import org .rest .common .web .RestPreconditions ;
1111import org .rest .sec .model .dto .User ;
1212import org .rest .sec .persistence .service .dto .IUserService ;
13+ import org .rest .sec .util .SecurityConstants ;
1314import org .rest .util .SearchCommonUtil ;
1415import org .rest .web .common .AbstractController ;
1516import org .rest .web .common .ISortingController ;
1617import org .springframework .beans .factory .annotation .Autowired ;
1718import org .springframework .dao .InvalidDataAccessApiUsageException ;
1819import org .springframework .http .HttpStatus ;
20+ import org .springframework .security .access .annotation .Secured ;
1921import org .springframework .stereotype .Controller ;
2022import org .springframework .web .bind .annotation .PathVariable ;
2123import org .springframework .web .bind .annotation .RequestBody ;
@@ -102,7 +104,6 @@ public User findOneByName( @RequestParam( "name" ) final String name ){
102104
103105 @ RequestMapping ( method = RequestMethod .POST )
104106 @ ResponseStatus ( HttpStatus .CREATED )
105- // @Secured( SecurityConstants.PRIVILEGE_USER_WRITE )
106107 public void create ( @ RequestBody final User resource , final UriComponentsBuilder uriBuilder , final HttpServletResponse response ){
107108 createInternal ( resource , uriBuilder , response );
108109 }
@@ -111,7 +112,7 @@ public void create( @RequestBody final User resource, final UriComponentsBuilder
111112
112113 @ RequestMapping ( method = RequestMethod .PUT )
113114 @ ResponseStatus ( HttpStatus .OK )
114- // @Secured( SecurityConstants.CAN_USER_WRITE )
115+ @ Secured ( SecurityConstants .CAN_USER_WRITE )
115116 public void update ( @ RequestBody final User resource ){
116117 updateInternal ( resource );
117118 }
@@ -120,7 +121,7 @@ public void update( @RequestBody final User resource ){
120121
121122 @ RequestMapping ( value = "/{id}" ,method = RequestMethod .DELETE )
122123 @ ResponseStatus ( HttpStatus .NO_CONTENT )
123- // @Secured( SecurityConstants.CAN_USER_WRITE )
124+ @ Secured ( SecurityConstants .CAN_USER_WRITE )
124125 public void delete ( @ PathVariable ( "id" ) final Long id ){
125126 deleteByIdInternal ( id );
126127 }
0 commit comments