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"
|
2016-05-24 16:55:13 +03:00
|
|
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
2017-06-09 15:39:06 -05:00
|
|
|
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd
|
2016-05-24 16:55:13 +03:00
|
|
|
http://www.springframework.org/schema/security
|
2017-06-09 15:39:06 -05:00
|
|
|
http://www.springframework.org/schema/security/spring-security-4.2.xsd">
|
2009-11-19 14:53:59 +01:00
|
|
|
|
2016-05-12 17:41:35 +03:00
|
|
|
<!--
|
|
|
|
|
NOTE: see
|
2010-01-13 14:06:42 +01:00
|
|
|
|
2016-05-12 17:41:35 +03:00
|
|
|
http://static.springsource.org/spring-security/site/docs/2.0.x/apidocs/org/springframework/security/vote/AuthenticatedVoter.html
|
|
|
|
|
|
|
|
|
|
for an explanation of the meaning of IS_AUTHENTICATED_ANONYMOUSLY and IS_AUTHENTICATED_FULLY. -->
|
|
|
|
|
|
|
|
|
|
<http auto-config="false" realm="LibrePlan Web Application" >
|
2014-04-28 01:01:24 +02:00
|
|
|
|
2016-11-09 18:31:42 +02:00
|
|
|
<!-- In Spring Security 4.1.0 it is useless to use hasRole() for single role because Spring is calling hasAnyRole() anyway -->
|
2016-11-01 15:13:03 +02:00
|
|
|
|
2009-11-19 14:53:59 +01:00
|
|
|
<!-- Web services -->
|
2016-10-27 18:26:01 +03:00
|
|
|
<intercept-url pattern="/ws/rest/bounduser/**" access="hasAnyRole('ROLE_BOUND_USER')" method="GET" />
|
|
|
|
|
<intercept-url pattern="/ws/rest/bounduser/**" access="hasAnyRole('ROLE_BOUND_USER')" method="POST" />
|
|
|
|
|
<intercept-url pattern="/ws/rest/subcontracting/**" access="hasAnyRole('ROLE_WS_SUBCONTRACTING')" method="GET" />
|
|
|
|
|
<intercept-url pattern="/ws/rest/subcontracting/**" access="hasAnyRole('ROLE_WS_SUBCONTRACTING')" method="POST" />
|
|
|
|
|
<intercept-url pattern="/ws/rest/**" access="hasAnyRole('ROLE_WS_READER')" method="GET" />
|
|
|
|
|
<intercept-url pattern="/ws/rest/**" access="hasAnyRole('ROLE_WS_WRITER')" method="POST" />
|
|
|
|
|
<intercept-url pattern="/ws/rest/**" access="hasAnyRole('ROLE_WS_WRITER')" method="DELETE" />
|
2009-11-19 14:53:59 +01:00
|
|
|
|
2011-05-20 13:56:11 +02:00
|
|
|
<!-- Web application -->
|
2016-05-12 17:41:35 +03:00
|
|
|
<intercept-url pattern="/common/img/**" access="permitAll" />
|
|
|
|
|
<intercept-url pattern="/common/css/**" access="permitAll" />
|
|
|
|
|
<intercept-url pattern="/planner/css/**" access="permitAll" />
|
|
|
|
|
<intercept-url pattern="/callback/**" access="permitAll" />
|
|
|
|
|
<intercept-url pattern="/zkau/**" access="permitAll" />
|
|
|
|
|
<intercept-url pattern="/help/**" access="permitAll" />
|
|
|
|
|
<intercept-url pattern="/common/layout/login.zul" access="isAnonymous()" />
|
|
|
|
|
<intercept-url pattern="/common/layout/timeout.zul" access="permitAll" />
|
2012-05-16 09:01:27 +02:00
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<!-- Pages -->
|
2016-05-12 17:41:35 +03:00
|
|
|
<intercept-url pattern="/templates/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_TEMPLATES')" />
|
2016-08-04 14:17:35 +03:00
|
|
|
<intercept-url pattern="/email/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_EDIT_EMAIL_TEMPLATES')"/>
|
2016-05-12 17:41:35 +03:00
|
|
|
<intercept-url pattern="/resources/worker/worker.zul" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_WORKERS')" />
|
|
|
|
|
<intercept-url pattern="/resources/machine/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_MACHINES')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/resources/worker/virtualWorkers.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_VIRTUAL_WORKERS')" />
|
|
|
|
|
|
|
|
|
|
<intercept-url pattern="/calendars/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_CALENDARS')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/excetiondays/*"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_CALENDAR_EXCEPTION_DAYS')" />
|
|
|
|
|
|
|
|
|
|
<intercept-url pattern="/resources/criterions/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_CRITERIA')" />
|
|
|
|
|
<intercept-url pattern="/advance/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_PROGRESS_TYPES')" />
|
|
|
|
|
<intercept-url pattern="/labels/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_LABELS')" />
|
|
|
|
|
<intercept-url pattern="/materials/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_MATERIALS')" />
|
|
|
|
|
<intercept-url pattern="/unittypes/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_MATERIAL_UNITS')" />
|
|
|
|
|
<intercept-url pattern="/qualityforms/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_QUALITY_FORMS')" />
|
|
|
|
|
<intercept-url pattern="/workreports/workReport.zul" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_TIMESHEETS')" />
|
|
|
|
|
|
2011-05-20 13:56:11 +02:00
|
|
|
<intercept-url pattern="/workreports/workReportTypes.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_TIMESHEETS_TEMPLATES')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/expensesheet/*"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_EXPENSES', 'ROLE_BOUND_USER')" />
|
|
|
|
|
|
|
|
|
|
<intercept-url pattern="/costcategories/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_COST_CATEGORIES')" />
|
|
|
|
|
<intercept-url pattern="/typeofworkhours/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_HOURS_TYPES')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/common/configuration.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_MAIN_SETTINGS')" />
|
|
|
|
|
|
|
|
|
|
<intercept-url pattern="/users/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_USER_ACCOUNTS')" />
|
|
|
|
|
<intercept-url pattern="/profiles/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_PROFILES')" />
|
|
|
|
|
<intercept-url pattern="/externalcompanies/*" access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_COMPANIES')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/subcontract/subcontractedTasks.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_SEND_TO_SUBCONTRACTORS')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/subcontract/subcontractorCommunications.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_RECEIVED_FROM_SUBCONTRACTORS')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/subcontract/reportAdvances.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_SEND_TO_CUSTOMERS')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/subcontract/customerCommunications.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_RECEIVED_FROM_CUSTOMERS')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/workreports/workReportQuery.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_TIMESHEET_LINES_LIST')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/hoursWorkedPerWorkerReport.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_HOURS_WORKED_PER_RESOURCE_REPORT')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/hoursWorkedPerWorkerInAMonthReport.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_TOTAL_WORKED_HOURS_BY_RESOURCE_IN_A_MONTH_REPORT')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/schedulingProgressPerOrderReport.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_WORK_AND_PROGRESS_PER_PROJECT_REPORT')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/workingProgressPerTaskReport.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_WORK_AND_PROGRESS_PER_TASK_REPORT')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/completedEstimatedHoursPerTask.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_ESTIMATED_PLANNED_HOURS_PER_TASK_REPORT')" />
|
|
|
|
|
|
2016-10-17 16:54:49 +03:00
|
|
|
<intercept-url pattern="/reports/orderCostsPerResource.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_PROJECT_COSTS_REPORT')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/workingArrangementsPerOrderReport.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_TASK_SCHEDULING_STATUS_IN_PROJECT_REPORT')" />
|
|
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
<intercept-url pattern="/reports/timeLineMaterialReport.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_MATERIALS_NEED_AT_DATE_REPORT')" />
|
|
|
|
|
|
2016-10-17 16:54:49 +03:00
|
|
|
<intercept-url pattern="/reports/projectStatusReport.zul"
|
|
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_PROJECT_STATUS_REPORT')" />
|
|
|
|
|
|
2016-10-27 18:26:01 +03:00
|
|
|
<intercept-url pattern="/myaccount/userDashboard.zul" access="hasAnyRole('ROLE_BOUND_USER')" />
|
2016-05-12 17:41:35 +03:00
|
|
|
|
2012-06-15 12:54:26 +02:00
|
|
|
<intercept-url pattern="/myaccount/monthlyTimesheet.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_TIMESHEETS', 'ROLE_BOUND_USER')" />
|
|
|
|
|
|
2013-03-26 17:46:03 +01:00
|
|
|
<intercept-url pattern="/orders/imports/projectImport.zul"
|
2016-05-12 17:41:35 +03:00
|
|
|
access="hasAnyRole('ROLE_SUPERUSER', 'ROLE_IMPORT_PROJECTS')" />
|
2013-03-26 17:46:03 +01:00
|
|
|
|
2012-06-14 18:17:05 +02:00
|
|
|
|
2016-05-12 17:41:35 +03:00
|
|
|
<intercept-url pattern="/**" access="isFullyAuthenticated()" />
|
2012-05-16 09:01:27 +02:00
|
|
|
|
2016-05-12 17:41:35 +03: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 />
|
2016-10-17 16:54:49 +03: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"
|
|
|
|
|
login-processing-url="/j_spring_security_check"
|
|
|
|
|
username-parameter="j_username"
|
|
|
|
|
password-parameter="j_password"/>
|
2012-05-16 09:01:27 +02:00
|
|
|
<http-basic />
|
2016-05-13 17:01:29 +03:00
|
|
|
<logout logout-url="/j_spring_security_logout" />
|
2016-10-26 17:20:38 +03:00
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
In Spring Security 4 by default frame option policy became DENY.
|
|
|
|
|
See: http://forum.zkoss.org/question/99483/fileupload-not-worked/
|
|
|
|
|
-->
|
|
|
|
|
<headers>
|
|
|
|
|
<frame-options policy="SAMEORIGIN"/>
|
|
|
|
|
</headers>
|
|
|
|
|
|
2012-05-16 09:01:27 +02:00
|
|
|
<remember-me />
|
2016-05-12 17:41:35 +03:00
|
|
|
<csrf disabled="true"/>
|
2009-11-19 14:53:59 +01:00
|
|
|
|
|
|
|
|
</http>
|
|
|
|
|
|
2016-05-12 17:41:35 +03:00
|
|
|
<!-- Beans used by Spring Security (current configuration assumes users are registered in the database). -->
|
2011-05-27 14:27:48 +02:00
|
|
|
<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" />
|
2016-05-12 17:41:35 +03:00
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
Beans used by the LibrePlan Web application when users are registered in the database.
|
|
|
|
|
When users are registered externally (e.g. in a LDAP server),these lines may be commented.
|
|
|
|
|
-->
|
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" />
|
2016-05-12 17:41:35 +03:00
|
|
|
<!--
|
|
|
|
|
Beans used by the LibrePlan Web Application when users are registerd 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 -->
|
2011-05-20 13:56:11 +02:00
|
|
|
<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
|
|
|
|
2016-05-12 17:41:35 +03: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>
|
|
|
|
|
|
2016-05-10 13:20:53 +03:00
|
|
|
<beans:bean id="authenticationProvider"
|
|
|
|
|
class="org.libreplan.web.users.services.AuthenticationProviderLoggingDecorator">
|
|
|
|
|
<beans:property name="decoratedProvider" ref="realAuthenticationProvider"/>
|
2011-05-20 13:56:11 +02:00
|
|
|
</beans:bean>
|
2009-12-11 13:11:58 +01:00
|
|
|
|
2016-05-12 17:41:35 +03:00
|
|
|
<!-- This bean is used to implement UserDetailsService with LDAP authentication Provider -->
|
2016-05-10 13:20:53 +03:00
|
|
|
<beans:bean id="ldapUserDetailsService" 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>
|