Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rnavagamuwa/a7bf083dee682f1662d3c47b4eff3efd to your computer and use it in GitHub Desktop.
Save rnavagamuwa/a7bf083dee682f1662d3c47b4eff3efd to your computer and use it in GitHub Desktop.
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class MethodSecurityConfig extends GlobalMethodSecurityConfiguration {
@Override
protected MethodSecurityExpressionHandler createExpressionHandler() {
DefaultMethodSecurityExpressionHandler expressionHandler =
new DefaultMethodSecurityExpressionHandler();
expressionHandler.setPermissionEvaluator(new AttributeEvaluator());
return expressionHandler;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment