Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdmlib / cdmlib-persistence / src / main / resources / eu / etaxonomy / cdm / security_base.xml @ 376b705d

History | View | Annotate | Download (3.9 KB)

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.permission.UnanimousBasedUnrevokable">
39
        <constructor-arg>
40
            <list>
41
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.GrantAlwaysVoter" />
42
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.TaxonNodeVoter" />
43
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.TaxonBaseVoter" />
44
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.DescriptionBaseVoter" />
45
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.DescriptionElementVoter" />
46
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.TaxonNameVoter" />
47
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.ReferenceVoter" />
48
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.CollectionVoter" />
49
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.TeamOrPersonBaseVoter" />
50
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.RegistrationVoter" />
51
                <bean class="eu.etaxonomy.cdm.persistence.permission.voter.SpecimenOrObservationBaseVoter" />
52
            </list>
53
        </constructor-arg>
54
    </bean>
55

    
56
    <!--
57
        CdmPermissionEvaluator.hasPermissions() evaluates the CdmPermissions like TAXONNODE.UPDATE{20c8f083-5870-4cbd-bf56-c5b2b98ab6a7}
58
    -->
59
    <bean id="cdmPermissionEvaluator" class="eu.etaxonomy.cdm.persistence.permission.CdmPermissionEvaluator">
60
        <property name="accessDecisionManager" ref="accessDecisionManager" />
61
    </bean>
62

    
63
    <!-- The CdmSecurityHibernateInterceptor checks onSave() and on flushDirty() if the currently authenticated principal or token  has
64
    sufficient permissions on the entity to be persisted -->
65
    <bean id="securityHibernateInterceptor" class="eu.etaxonomy.cdm.persistence.hibernate.CdmSecurityHibernateInterceptor">
66
        <property name="permissionEvaluator" ref="cdmPermissionEvaluator" />
67
    </bean>
68

    
69
</beans>
Add picture from clipboard (Maximum size: 40 MB)