Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans:beans xmlns="http://www.springframework.org/schema/security"
  3. xmlns:beans="http://www.springframework.org/schema/beans"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans
  6. http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  7. http://www.springframework.org/schema/security
  8. http://www.springframework.org/schema/security/spring-security.xsd">
  9.  
  10. <global-method-security pre-post-annotations="enabled" />
  11.  
  12. <http use-expressions ="true">
  13. <intercept-url pattern="/users**" access="hasRole('ROLE_ADMIN')" />
  14. <intercept-url pattern="/users/**" access="hasRole('ROLE_ADMIN')" />
  15. <intercept-url pattern="/account**" access="hasRole('ROLE_USER')" />
  16. <form-login login-page="/login.html"/>
  17. <logout logout-url="/logout" />
  18. </http>
  19.  
  20. <authentication-manager>
  21. <authentication-provider>
  22.  
  23. <password-encoder hash="bcrypt" />
  24.  
  25. <jdbc-user-service data-source-ref="dataSource"
  26. authorities-by-username-query="select app_user.name, role.name from app_user
  27. join app_user_role on app_user.id = app_user_role.users_id
  28. join role on app_user_role.roles_id = role.id
  29. where app_user.name = ?"
  30. users-by-username-query="select name, password, enabled from app_user where name = ?" />
  31. </authentication-provider>
  32. </authentication-manager>
  33.  
  34.  
  35. </beans:beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement