Permalink
Browse files

actualizacion de beans finalizando el proceso de agregar seguridad.

  • Loading branch information...
1 parent 8b8b0d8 commit 5b0085caa87a5c1c97ebd2f2e81ea0d9beaf0985 @donreno committed Jan 30, 2012
Showing with 30 additions and 0 deletions.
  1. +30 −0 envaflex-rest-business/src/main/webapp/WEB-INF/security-config.xml
@@ -0,0 +1,30 @@
+<beans:beans xmlns="http://www.springframework.org/schema/security"
+ xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
+
+ <http auto-config="true" use-expressions="true">
+ <intercept-url pattern="/service/cargo/list" access="hasRole('ADMINISTRADOR')" />
+ <intercept-url pattern="/service/cargo/hola" access="hasAnyRole('ADMINISTRADOR','VENDEDOR','SUPERVISOR')" />
+ <form-login login-page="/service/security/login" />
+ </http>
+
+ <global-method-security
+ secured-annotations="enabled" />
+ <authentication-manager alias="authenticationManager">
+ <authentication-provider >
+ <jdbc-user-service data-source-ref="securityDataSource"
+ users-by-username-query="
+ select user_name,password, true
+ from empleado
+ where user_name=?"
+
+ authorities-by-username-query=
+ "select e.user_name,c.nombre_cargo from empleado e, cargo c
+ where e.id_cargo = c.id_cargo
+ and e.user_name = ?"
+
+ role-prefix=""/>
+ </authentication-provider>
+ </authentication-manager>
+</beans:beans>

0 comments on commit 5b0085c

Please sign in to comment.