I am new to ss3 and I read its link, also read spring security book.
However, I did not find anything about role resolution.
For example, here is a configuration for forms-based authentication.
<http auto-config='true'> <intercept-url pattern="/user/add/**" access="hasRole('USER_ADMIN')"/> <intercept-url pattern="/user/delete/**" access="hasRole('USER_ADMIN')"/> <intercept-url pattern="/login.jsp*" access="IS_AUTHENTICATED_ANONYMOUSLY"/> <intercept-url pattern="/**" access="ROLE_USER" /> <form-login login-page='/login.jsp'/> </http>
I want to control the user's work (add / remove):
<intercept-url pattern="/user/add/**" access="hasRole('USER_ADMIN')"/> <intercept-url pattern="/user/delete/**" access="hasRole('USER_ADMIN')"/>
I define the role "USER_ADMIN", but this is not enough, because I want to be different from a user who has "add" permission from a user who has permission to "delete".
Perhaps I can add several roles, such as 'user_admin_add' and 'user_admin_delete'.
But I don’t think this is a good idea, because add or remove are permissions, not roles.
How to do it?
Also, it seems that all roles should be configured in an XML file, I wonder if I can dynamically add new roles and permissions (on the admin page)?
source share