Additional theme removal updates
See gh-33809
This commit is contained in:
@@ -14,14 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
package org.springframework.docs.web.webmvc.mvcconfig.mvcconfiginterceptors
|
||||
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
||||
import org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor
|
||||
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor
|
||||
import org.springframework.web.servlet.theme.ThemeChangeInterceptor
|
||||
|
||||
// tag::snippet[]
|
||||
@Configuration
|
||||
@@ -29,7 +28,7 @@ class WebConfiguration : WebMvcConfigurer {
|
||||
|
||||
override fun addInterceptors(registry: InterceptorRegistry) {
|
||||
registry.addInterceptor(LocaleChangeInterceptor())
|
||||
registry.addInterceptor(ThemeChangeInterceptor()).addPathPatterns("/**").excludePathPatterns("/admin/**")
|
||||
registry.addInterceptor(UserRoleAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/admin/**")
|
||||
}
|
||||
}
|
||||
// end::snippet[]
|
||||
@@ -14,7 +14,9 @@
|
||||
<mvc:interceptor>
|
||||
<mvc:mapping path="/**"/>
|
||||
<mvc:exclude-mapping path="/admin/**"/>
|
||||
<bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor"/>
|
||||
<bean class="org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor">
|
||||
<property name="authorizedRoles" value="ROLE_USER"/>
|
||||
</bean>
|
||||
</mvc:interceptor>
|
||||
</mvc:interceptors>
|
||||
<!-- end::snippet[] -->
|
||||
|
||||
Reference in New Issue
Block a user