2009-11-19 14:53:59 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
|
|
<beans:beans xmlns="http://www.springframework.org/schema/security"
|
2011-05-20 13:56:11 +02:00
|
|
|
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
2009-12-11 13:11:58 +01:00
|
|
|
xmlns:p="http://www.springframework.org/schema/p"
|
2014-05-06 18:39:06 +02:00
|
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
2014-05-01 16:36:02 +02:00
|
|
|
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd">
|
2009-11-19 14:53:59 +01:00
|
|
|
|
2011-06-01 16:28:21 +02:00
|
|
|
<!-- NOTE: see http://static.springsource.org/spring-security/site/docs/2.0.x/apidocs/org/springframework/security/vote/AuthenticatedVoter.html
|
2011-05-20 13:56:11 +02:00
|
|
|
for an explanation of the meaning of IS_AUTHENTICATED_ANONYMOUSLY and IS_AUTHENTICATED_FULLY. -->
|
2010-01-13 14:06:42 +01:00
|
|
|
|
2014-04-30 19:25:52 +02:00
|
|
|
<http auto-config="false" realm="LibrePlan Web Application">
|
2014-04-28 01:01:24 +02:00
|
|
|
|
2009-11-19 14:53:59 +01:00
|
|
|
<!-- Web services -->
|
2012-11-07 21:41:12 +01:00
|
|
|
<intercept-url pattern="/ws/rest/bounduser/**"
|
|
|
|
|
access="ROLE_BOUND_USER"
|
|
|
|
|
method="GET" />
|
|
|
|
|
<intercept-url pattern="/ws/rest/bounduser/**"
|
|
|
|
|
access="ROLE_BOUND_USER"
|
|
|
|
|
method="POST" />
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/ws/rest/subcontracting/**"
|
|
|
|
|
access="ROLE_WS_SUBCONTRACTING"
|
2012-06-11 13:49:37 +02:00
|
|
|
method="GET" />
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/ws/rest/subcontracting/**"
|
|
|
|
|
access="ROLE_WS_SUBCONTRACTING"
|
2012-06-11 13:49:37 +02:00
|
|
|
method="POST" />
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/ws/rest/**"
|
|
|
|
|
access="ROLE_WS_READER"
|
2011-05-20 13:56:11 +02:00
|
|
|
method="GET" />
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/ws/rest/**"
|
|
|
|
|
access="ROLE_WS_WRITER"
|
2011-05-20 13:56:11 +02:00
|
|
|
method="POST" />
|
2012-08-27 11:42:10 +02:00
|
|
|
<intercept-url pattern="/ws/rest/**"
|
|
|
|
|
access="ROLE_WS_WRITER"
|
|
|
|
|
method="DELETE" />
|
2009-11-19 14:53:59 +01:00
|
|
|
|
2011-05-20 13:56:11 +02:00
|
|
|
<!-- Web application -->
|
|
|
|
|
<intercept-url pattern="/common/img/**"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
|
|
|
|
<intercept-url pattern="/common/css/**"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
|
|
|
|
<intercept-url pattern="/planner/css/**"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
|
|
|
|
<intercept-url pattern="/callback/**"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
|
|
|
|
<intercept-url pattern="/zkau/**"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
|
|
|
|
<intercept-url pattern="/help/**"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
|
|
|
|
<intercept-url pattern="/common/layout/login.zul"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
|
|
|
|
<intercept-url pattern="/common/layout/timeout.zul"
|
|
|
|
|
access="IS_AUTHENTICATED_ANONYMOUSLY" />
|
2012-05-16 09:01:27 +02:00
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<!-- Pages -->
|
|
|
|
|
<intercept-url pattern="/templates/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_TEMPLATES" />
|
|
|
|
|
<intercept-url pattern="/resources/worker/worker.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_WORKERS" />
|
|
|
|
|
<intercept-url pattern="/resources/machine/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_MACHINES" />
|
|
|
|
|
<intercept-url pattern="/resources/worker/virtualWorkers.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_VIRTUAL_WORKERS" />
|
|
|
|
|
<intercept-url pattern="/calendars/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_CALENDARS" />
|
|
|
|
|
<intercept-url pattern="/excetiondays/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_CALENDAR_EXCEPTION_DAYS" />
|
|
|
|
|
<intercept-url pattern="/resources/criterions/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_CRITERIA" />
|
|
|
|
|
<intercept-url pattern="/advance/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_PROGRESS_TYPES" />
|
|
|
|
|
<intercept-url pattern="/labels/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_LABELS" />
|
|
|
|
|
<intercept-url pattern="/materials/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_MATERIALS" />
|
|
|
|
|
<intercept-url pattern="/unittypes/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_MATERIAL_UNITS" />
|
|
|
|
|
<intercept-url pattern="/qualityforms/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_QUALITY_FORMS" />
|
|
|
|
|
<intercept-url pattern="/workreports/workReport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_TIMESHEETS" />
|
2011-05-20 13:56:11 +02:00
|
|
|
<intercept-url pattern="/workreports/workReportTypes.zul"
|
2012-06-14 18:17:05 +02:00
|
|
|
access="ROLE_SUPERUSER,ROLE_TIMESHEETS_TEMPLATES" />
|
|
|
|
|
<intercept-url pattern="/expensesheet/*"
|
2012-06-15 12:54:26 +02:00
|
|
|
access="ROLE_SUPERUSER,ROLE_EXPENSES,ROLE_BOUND_USER" />
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/costcategories/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_COST_CATEGORIES" />
|
|
|
|
|
<intercept-url pattern="/typeofworkhours/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_HOURS_TYPES" />
|
|
|
|
|
<intercept-url pattern="/common/configuration.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_MAIN_SETTINGS" />
|
|
|
|
|
<intercept-url pattern="/users/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_USER_ACCOUNTS" />
|
|
|
|
|
<intercept-url pattern="/profiles/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_PROFILES" />
|
|
|
|
|
<intercept-url pattern="/externalcompanies/*"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_COMPANIES" />
|
|
|
|
|
<intercept-url pattern="/subcontract/subcontractedTasks.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_SEND_TO_SUBCONTRACTORS" />
|
|
|
|
|
<intercept-url pattern="/subcontract/subcontractorCommunications.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_RECEIVED_FROM_SUBCONTRACTORS" />
|
|
|
|
|
<intercept-url pattern="/subcontract/reportAdvances.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_SEND_TO_CUSTOMERS" />
|
|
|
|
|
<intercept-url pattern="/subcontract/customerCommunications.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_RECEIVED_FROM_CUSTOMERS" />
|
|
|
|
|
<intercept-url pattern="/workreports/workReportQuery.zul"
|
2012-07-09 19:02:48 +02:00
|
|
|
access="ROLE_SUPERUSER,ROLE_TIMESHEET_LINES_LIST" />
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/hoursWorkedPerWorkerReport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_HOURS_WORKED_PER_RESOURCE_REPORT" />
|
|
|
|
|
<intercept-url pattern="/reports/hoursWorkedPerWorkerInAMonthReport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_TOTAL_WORKED_HOURS_BY_RESOURCE_IN_A_MONTH_REPORT" />
|
|
|
|
|
<intercept-url pattern="/reports/schedulingProgressPerOrderReport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_WORK_AND_PROGRESS_PER_PROJECT_REPORT" />
|
|
|
|
|
<intercept-url pattern="/reports/workingProgressPerTaskReport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_WORK_AND_PROGRESS_PER_TASK_REPORT" />
|
|
|
|
|
<intercept-url pattern="/reports/completedEstimatedHoursPerTask.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_ESTIMATED_PLANNED_HOURS_PER_TASK_REPORT" />
|
|
|
|
|
<intercept-url pattern="/reportsorderCostsPerResource/.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_PROJECT_COSTS_REPORT" />
|
|
|
|
|
<intercept-url pattern="/reports/workingArrangementsPerOrderReport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_TASK_SCHEDULING_STATUS_IN_PROJECT_REPORT" />
|
|
|
|
|
<intercept-url pattern="/reports/timeLineMaterialReport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_MATERIALS_NEED_AT_DATE_REPORT" />
|
2012-06-15 12:54:26 +02:00
|
|
|
<intercept-url pattern="/myaccount/userDashboard.zul"
|
|
|
|
|
access="ROLE_BOUND_USER" />
|
|
|
|
|
<intercept-url pattern="/myaccount/monthlyTimesheet.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_TIMESHEETS,ROLE_BOUND_USER" />
|
2013-03-26 17:46:03 +01:00
|
|
|
<intercept-url pattern="/orders/imports/projectImport.zul"
|
|
|
|
|
access="ROLE_SUPERUSER,ROLE_IMPORT_PROJECTS" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
|
2010-01-13 14:06:42 +01:00
|
|
|
<intercept-url pattern="/**" access="IS_AUTHENTICATED_FULLY" />
|
2012-05-16 09:01:27 +02:00
|
|
|
|
2012-05-16 10:36:05 +02:00
|
|
|
<!-- These have been added because of auto-config is false now in order
|
|
|
|
|
to use a custom authentication filter.
|
|
|
|
|
See: http://static.springsource.org/spring-security/site/docs/2.0.x/reference/ns-config.html#ns-auto-config -->
|
2012-05-16 09:01:27 +02:00
|
|
|
<anonymous />
|
2014-04-30 19:25:52 +02:00
|
|
|
<form-login login-page="/common/layout/login.zul"
|
|
|
|
|
default-target-url="/common/index.zul"
|
|
|
|
|
authentication-failure-url="/common/layout/login.zul?login_error=true" />
|
2012-05-16 09:01:27 +02:00
|
|
|
<http-basic />
|
|
|
|
|
<logout />
|
|
|
|
|
<remember-me />
|
2009-11-19 14:53:59 +01:00
|
|
|
|
|
|
|
|
</http>
|
|
|
|
|
|
2011-05-20 13:56:11 +02:00
|
|
|
<!-- Beans used by Spring Security (current configuration assumes users
|
2011-05-27 14:27:48 +02:00
|
|
|
are registered in the database). -->
|
|
|
|
|
<beans:bean id="passwordEncoder"
|
2014-04-28 01:01:24 +02:00
|
|
|
class="org.springframework.security.authentication.encoding.ShaPasswordEncoder">
|
2011-05-27 14:27:48 +02:00
|
|
|
<beans:constructor-arg value="512" />
|
|
|
|
|
</beans:bean>
|
2011-05-27 14:27:49 +02:00
|
|
|
|
2011-05-27 14:27:48 +02:00
|
|
|
<beans:bean id="saltSource"
|
2014-04-28 01:01:24 +02:00
|
|
|
class="org.springframework.security.authentication.dao.ReflectionSaltSource"
|
2011-05-27 14:27:48 +02:00
|
|
|
p:userPropertyToUse="username" />
|
2011-08-10 18:32:29 +02:00
|
|
|
<!-- <beans:bean id="realAuthenticationProvider" class="org.springframework.security.providers.dao.DaoAuthenticationProvider"
|
2009-12-11 13:11:58 +01:00
|
|
|
p:passwordEncoder-ref="passwordEncoder" p:saltSource-ref="saltSource" p:userDetailsService-ref="dbUserDetailsService">
|
2011-05-27 14:27:49 +02:00
|
|
|
<custom-authentication-provider/> </beans:bean> -->
|
2011-10-28 08:17:54 +02:00
|
|
|
<!-- Beans used by the LibrePlan Web application when users are registered
|
2011-05-20 13:56:11 +02:00
|
|
|
in the database. When users are registered externally (e.g. in a LDAP server),
|
2011-10-28 08:17:54 +02:00
|
|
|
these lines may be commented. <beans:bean id="dbUserDetailsService" class="org.libreplan.web.users.services.DBUserDetailsService"/> -->
|
2011-05-27 14:27:48 +02:00
|
|
|
<beans:bean id="dbPasswordEncoderService"
|
2011-10-28 08:17:54 +02:00
|
|
|
class="org.libreplan.web.users.services.DBPasswordEncoderService"
|
2011-05-27 14:27:48 +02:00
|
|
|
p:passwordEncoder-ref="passwordEncoder" p:saltSource-ref="saltSource" />
|
2011-05-27 14:27:49 +02:00
|
|
|
|
2011-05-27 14:27:48 +02:00
|
|
|
<beans:bean id="usersBootstrapInDB"
|
2011-10-28 08:17:54 +02:00
|
|
|
class="org.libreplan.web.users.bootstrap.UsersBootstrapInDB"
|
2011-05-27 14:27:48 +02:00
|
|
|
p:dbPasswordEncoderService-ref="dbPasswordEncoderService" />
|
2011-10-28 08:17:54 +02:00
|
|
|
<!-- Beans used by the LibrePlan Web Application when users are registerd
|
2011-05-20 13:56:11 +02:00
|
|
|
in LDAP. At this moment users MUST be also in database with same username.
|
|
|
|
|
This will be changed in the near future. the url, base, userDN and password
|
|
|
|
|
properties must be set with the proper values -->
|
|
|
|
|
<beans:bean id="contextSource"
|
2011-10-28 08:17:54 +02:00
|
|
|
class="org.libreplan.web.users.services.LDAPCustomContextSource">
|
2009-12-11 13:11:58 +01:00
|
|
|
</beans:bean>
|
|
|
|
|
|
2011-05-20 13:56:11 +02:00
|
|
|
<beans:bean id="ldapTemplate"
|
|
|
|
|
class="org.springframework.ldap.core.LdapTemplate"
|
|
|
|
|
p:contextSource-ref="contextSource">
|
|
|
|
|
</beans:bean>
|
2009-12-11 13:11:58 +01:00
|
|
|
|
2011-05-20 13:56:11 +02:00
|
|
|
<!-- This authentication provider will make possible all the login process
|
|
|
|
|
when an LDAP is used. Also will allow authenticate users in database. The
|
|
|
|
|
property strUserId must be set with the proper value. It represents the property
|
|
|
|
|
of the user in LDAP which will be used to check the username. -->
|
2011-08-10 18:32:29 +02:00
|
|
|
<beans:bean id="realAuthenticationProvider"
|
2011-10-28 08:17:54 +02:00
|
|
|
class="org.libreplan.web.users.services.LDAPCustomAuthenticationProvider"
|
2011-05-20 13:56:11 +02:00
|
|
|
p:userDetailsService-ref="ldapUserDetailsService"
|
2011-05-27 14:27:49 +02:00
|
|
|
p:ldapTemplate-ref="ldapTemplate"
|
|
|
|
|
p:passwordEncoderService-ref="dbPasswordEncoderService">
|
2011-08-10 18:32:29 +02:00
|
|
|
</beans:bean>
|
|
|
|
|
|
2011-10-28 08:17:54 +02:00
|
|
|
<beans:bean id="authenticationProvider" class="org.libreplan.web.users.services.AuthenticationProviderLoggingDecorator">
|
2011-08-10 18:32:29 +02:00
|
|
|
<beans:property name="decoratedProvider" ref="realAuthenticationProvider"></beans:property>
|
2011-05-20 13:56:11 +02:00
|
|
|
</beans:bean>
|
2009-12-11 13:11:58 +01:00
|
|
|
|
2011-05-20 13:56:11 +02:00
|
|
|
<!-- This bean is used to implement UserDetailsService with LDAP authentication
|
|
|
|
|
Provider. -->
|
|
|
|
|
<beans:bean id="ldapUserDetailsService"
|
2011-10-28 08:17:54 +02:00
|
|
|
class="org.libreplan.web.users.services.LDAPUserDetailsService" />
|
2012-05-16 09:01:27 +02:00
|
|
|
|
2014-04-30 19:25:52 +02:00
|
|
|
<authentication-manager>
|
2014-04-28 01:01:24 +02:00
|
|
|
<authentication-provider ref="authenticationProvider"/>
|
|
|
|
|
</authentication-manager>
|
2012-05-16 09:01:27 +02:00
|
|
|
|
2011-08-10 18:32:29 +02:00
|
|
|
</beans:beans>
|