minor fix

This commit is contained in:
DOHA 2016-07-30 20:40:40 +02:00
parent 42b551546a
commit 883ec051b1
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,6 @@ import org.baeldung.persistence.model.Foo;
import org.baeldung.persistence.model.Organization; import org.baeldung.persistence.model.Organization;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@ -22,7 +21,8 @@ public class MainController {
@Autowired @Autowired
private OrganizationRepository organizationRepository; private OrganizationRepository organizationRepository;
@PostAuthorize("hasPermission(returnObject, 'read')") // @PostAuthorize("hasPermission(returnObject, 'read')")
@PreAuthorize("hasPermission(#id, 'Foo', 'read')")
@RequestMapping(method = RequestMethod.GET, value = "/foos/{id}") @RequestMapping(method = RequestMethod.GET, value = "/foos/{id}")
@ResponseBody @ResponseBody
public Foo findById(@PathVariable final long id) { public Foo findById(@PathVariable final long id) {