Reputation: 6774
@PreAuthorize
with hasRole
it works fine.hasPermission
, it doesn't work.Upvotes: 3
Views: 1023
Reputation: 1282
Please read the article on the following site: http://springinpractice.com/2010/10/27/quick-tip-spring-security-role-based-authorization-and-permissions/
The main thing is you will need to implement the UserDetails interface. It says "the UserDetails interface simply exposes the permissions (not the roles) via the getAuthorities() method"
Upvotes: 3