Skip to content
Permalink
Browse files

Turn on security for addCategory method

  • Loading branch information...
borabilgin committed Feb 1, 2019
1 parent ed8a505 commit 87047a694f30224a40dc0370b7f15b1ea763b499
Showing with 2 additions and 0 deletions.
  1. +2 −0 api/src/main/java/com/demo/imagebrowser/controller/FeedCategoryController.java
@@ -5,6 +5,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@@ -18,6 +19,7 @@
private FeedService feedService;

@RequestMapping(method = RequestMethod.PUT)
@PreAuthorize("hasAuthority('ADMIN')")
public ResponseEntity<FeedCategory> addCategory(@RequestParam() String categoryName) {
FeedCategory category = feedService.addCategory(categoryName);
return new ResponseEntity<>(category, HttpStatus.OK);

0 comments on commit 87047a6

Please sign in to comment.
You can’t perform that action at this time.