I\'m setting up a Spring Boot (v1.2.6) web project and using Spring Security (v3.2.8). I\'ve found the @PreAuthorize annotation so handy, but I don\'t know if there\'s a way
This should work:
@Value("${mysecurity.permit}")
private Boolean permit;
Then use:
@PreAuthorize(permit)
But you need to properly set configuration file, to allow Spring access it. Read here: https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
UPDATE: Did you configure bean for a property placeholder? For example:
classpath:com/foo/app.properties