spring security list of available roles
I have been searching on google the list of available roles in spring security, but I haven't been able to get the complete list.
¿Cou开发者_如何学Pythonld someone help me with this?
This is what I've found: ROLE_ADMIN, ROLE_USER, ROLE_VISITOR.
The list of roles is not dictated by Spring Security, but is entirely up to what is required in a particular application.
The list of roles could for example be stored in the application's database. See for an example Spring Security's JdbcUserDetailsManager class which can be readily used to manage users, roles and authorities (privileges) in the database.
As Markus said there are no fixed number of roles in spring security.
Have a look at the javadoc for org.springframework.security.core.GrantedAuthority
.
Extending it allows you to override the getAuthority
method from which you can return any role string you like.
精彩评论