1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
3
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
4
|
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
|
5
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
6
|
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
7
|
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
|
8
|
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
|
9
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
|
10
|
">
|
11
|
|
12
|
|
13
|
|
14
|
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean" depends-on="tableGeneratorGlobalOverride">
|
15
|
<property name="implicitNamingStrategy">
|
16
|
<bean class="org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl" />
|
17
|
</property>
|
18
|
|
19
|
<property name="entityInterceptor" ref="securityHibernateInterceptor" />
|
20
|
|
21
|
<property name="configLocation" value="classpath:eu/etaxonomy/cdm/hibernate.cfg.xml"/>
|
22
|
|
23
|
<!--
|
24
|
If dataSource is set, this will override corresponding settings in Hibernate properties.
|
25
|
If this is set, the Hibernate settings should not define a connection provider to
|
26
|
avoid meaningless double configuration.
|
27
|
|
28
|
see also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)
|
29
|
-->
|
30
|
<property name="dataSource" ref="dataSource"/>
|
31
|
<property name="hibernateProperties" ref="hibernateProperties"/>
|
32
|
</bean>
|
33
|
|
34
|
|
35
|
<!--
|
36
|
============================== SECURITY ==============================
|
37
|
-->
|
38
|
<bean id="accessDecisionManager" class="eu.etaxonomy.cdm.persistence.hibernate.permission.UnanimousBasedUnrevokable">
|
39
|
<constructor-arg>
|
40
|
<list>
|
41
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.GrantAlwaysVoter" />
|
42
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonNodeVoter" />
|
43
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonBaseVoter" />
|
44
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionBaseVoter" />
|
45
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.DescriptionElementVoter" />
|
46
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TaxonNameVoter" />
|
47
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.ReferenceVoter" />
|
48
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.TeamOrPersonBaseVoter" />
|
49
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.RegistrationVoter" />
|
50
|
<bean class="eu.etaxonomy.cdm.persistence.hibernate.permission.voter.SpecimenOrObservationBaseVoter" />
|
51
|
</list>
|
52
|
</constructor-arg>
|
53
|
</bean>
|
54
|
|
55
|
<!--
|
56
|
CdmPermissionEvaluator.hasPermissions() evaluates the CdmPermissions like TAXONNODE.UPDATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7}
|
57
|
-->
|
58
|
<bean id="cdmPermissionEvaluator" class="eu.etaxonomy.cdm.persistence.hibernate.permission.CdmPermissionEvaluator">
|
59
|
<property name="accessDecisionManager" ref="accessDecisionManager" />
|
60
|
</bean>
|
61
|
|
62
|
<!-- The CdmSecurityHibernateInterceptor checks onSave() and on flushDirty() if the currently authenticated principal or token has
|
63
|
sufficient permissions on the entity to be persisted -->
|
64
|
<bean id="securityHibernateInterceptor" class="eu.etaxonomy.cdm.persistence.hibernate.CdmSecurityHibernateInterceptor">
|
65
|
<property name="permissionEvaluator" ref="cdmPermissionEvaluator" />
|
66
|
</bean>
|
67
|
|
68
|
</beans>
|