I am using spring and spring security 4 in my project. I have to call my dao method with ROLE_USER or ROLE_TIMER_TASK.
Currently I am using this annotation -
In addition to the previous answer by holmis83....
To enable pre- and post- annnotations for method security:
Java Config:
@EnableGlobalMethodSecurity(prePostEnabled = true) public class MethodSecurityConfig { // ... }
Xml Config: