Hello,
i have configured my JEE6 WebApp to use SpringSecurity for Authentication. Login is allready working.
Now i would like to secure my methods with @PreAuthorize.
Allthough my User does not have the correct role he is still able to call the method.
Seems like the @PreAuthorize is not recognized with my CDI-Bean?
My Bean:
I have added following to my spring-security.xml:Code:@Model public class MyAuthenticator { private String anonym="Sample Text!"; @PreAuthorize("hasRole('ROLE_TEST')") public void setAnonym(){ anonym="Anonym Button: "+getTime(); } ... }
The method is called from myAuthenticator.xhtmlCode:<global-method-security pre-post-annotations="enabled" />
Code:... <h:commandButton type="submit" action="#{myAuthenticator.setAnonym}" value="setAnonym" /> ...


Reply With Quote
