Project

General

Profile

Revision 2638be38

ID2638be38d1f2f957820ca1906df2aa1795123eb2
Parent 398bcf3e
Child 69f17e7e

Added by Andreas Müller over 4 years ago

migrate to hibernate 5 for cdmlib-services and cdmlib-ext #4716

  • (except for hibernate search tests)
  • including new spring-config structure

View differences:

cdmlib-services/src/main/resources/eu/etaxonomy/cdm/services_security.xml
28 28
    <!-- also find the implementation of ITaxonNodeComparator (otherwise it is not found by a component scan)  -->
29 29
    <bean name="taxonNodeByNameComparator" class="eu.etaxonomy.cdm.model.taxon.TaxonNodeByNameComparator"/>
30 30

  
31
    <!--
32
        ======================================================================
33
          security specific configuration
34
        ======================================================================
35
     -->
36
    <security:global-method-security pre-post-annotations="enabled" run-as-manager-ref="runAsManager" >
37
        <security:expression-handler ref="expressionHandler" />
38
    </security:global-method-security>
39

  
40
    <!--
41
        To use "hasPermission()" in the Spring EL method annotations like @PreAuthorize we explicitly configure the permissionEvaluator
42
        the cdmPermissionEvaluator is already defined in the persistence security context
43
    -->
44
    <bean id="expressionHandler" class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
45
        <property name="permissionEvaluator" ref="cdmPermissionEvaluator" />
46
    </bean>
47

  
48

  
49
    <bean id="daoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
50
        <property name="userDetailsService" ref="userService"/>
51
        <property name="saltSource" ref="saltSource"/>
52
        <property name="passwordEncoder" ref="passwordEncoder"/>
53
    </bean>
54

  
55
    <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.Md5PasswordEncoder"/>
56

  
57
    <bean id="saltSource" class="org.springframework.security.authentication.dao.ReflectionSaltSource">
58
        <property name="userPropertyToUse" value="getUsername"/>
59
    </bean>
31
    <import resource="classpath:/eu/etaxonomy/cdm/services_security_base.xml"/>
60 32
    
61
    <bean id="authenticationManager" class="org.springframework.security.authentication.ProviderManager">
62
        <constructor-arg>
63
            <list>
64
                <ref local="daoAuthenticationProvider"/>
65
            </list>
66
        </constructor-arg>
67
    </bean>
68

  
69

  
70
    <!--
71
        Run-As Authentication Replacement for system operations
72
        as e.g. performed by the eu.etaxonomy.cdm.api.application.FirstDataInserter
73

  
74
        the key must match FirstDataInserter.RUN_AS_KEY
75
     -->
76
    <bean id="runAsManager"
77
        class="org.springframework.security.access.intercept.RunAsManagerImpl">
78
      <property name="key" value="TtlCx3pgKC4l"/>
79
    </bean>
80

  
81
    <bean id="runAsAuthenticationProvider"
82
        class="org.springframework.security.access.intercept.RunAsImplAuthenticationProvider">
83
      <property name="key" value="TtlCx3pgKC4l"/>
84
    </bean>
85

  
86
    <!-- equips a new and empty database with the initial set of meta data and admin user   -->
87
    <bean id="firstDataInserter" class="eu.etaxonomy.cdm.api.application.FirstDataInserter">
88
        <property name="runAsAuthenticationProvider" ref="runAsAuthenticationProvider"/>
89
    </bean>
90

  
91 33
</beans>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)