36 lines
1.3 KiB
XML
36 lines
1.3 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
|
|
xsi:schemaLocation="
|
|
http://www.springframework.org/schema/security
|
|
http://www.springframework.org/schema/security/spring-security.xsd
|
|
http://www.springframework.org/schema/beans
|
|
http://www.springframework.org/schema/beans/spring-beans.xsd"
|
|
>
|
|
|
|
<http pattern="/securityNone" security="none"/>
|
|
|
|
<http use-expressions="true" >
|
|
<intercept-url pattern="/admin/*" access="hasAnyRole('ROLE_ADMIN')"/>
|
|
<intercept-url pattern="/**" access="isAuthenticated()"/>
|
|
|
|
<http-basic/>
|
|
|
|
<csrf disabled="true"/>
|
|
|
|
<!-- <access-denied-handler error-page="/my-error-page" /> -->
|
|
|
|
<access-denied-handler ref="customAccessDeniedHandler" />
|
|
</http>
|
|
|
|
<authentication-manager>
|
|
<authentication-provider>
|
|
<user-service>
|
|
<user name="user1" password="user1Pass" authorities="ROLE_USER"/>
|
|
<user name="admin" password="adminPass" authorities="ROLE_ADMIN"/>
|
|
</user-service>
|
|
</authentication-provider>
|
|
</authentication-manager>
|
|
|
|
<global-method-security pre-post-annotations="enabled"/>
|
|
|
|
</beans:beans> |