-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Create single point of defining the default role prefix #3701
Copy link
Copy link
Closed
Labels
in: configAn issue in spring-security-configAn issue in spring-security-configtype: enhancementA general enhancementA general enhancement
Milestone
Description
If one wants to change the default role prefix this must be done in more than one place and this can lead to errors if one of them is forgotten.
Currently I set it in 4 places:
<bean id="defaultMethodSecurityExpressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
<property name="defaultRolePrefix" value="ROLE:" />
</bean>
<bean id="defaultWebSecurityExpressionHandler" class="org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler">
<property name="defaultRolePrefix" value="ROLE:" />
</bean>
<bean id="securityContextHolderAwareRequestFilter" class="org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter">
<property name="rolePrefix" value="ROLE:" />
</bean>
<bean id="daoUserDetailsService" class="custom.DaoUserDetailsServiceImpl">
<property name="rolePrefix" value="ROLE:" />
</bean>Some strategy should be created to set the default role in a single place and the other components should use it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: configAn issue in spring-security-configAn issue in spring-security-configtype: enhancementA general enhancementA general enhancement