Project

General

Profile

Revision c621e94f

IDc621e94f4d389eb39e6004b154c99cd1c4b832d2
Parent 6ec42fab
Child 52df026c

Added by Andreas Kohlbecker over 2 years ago

ref #7648 using runAsAuthenticator for RunAsAdmin to configure TaxonGraphHibernateListener for vaadin

View differences:

src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
22 22
import org.hibernate.internal.SessionFactoryImpl;
23 23
import org.springframework.beans.BeansException;
24 24
import org.springframework.beans.factory.annotation.Autowired;
25
import org.springframework.beans.factory.annotation.Qualifier;
25 26
import org.springframework.context.ApplicationContext;
26 27
import org.springframework.context.ApplicationContextAware;
27 28
import org.springframework.context.annotation.Bean;
......
50 51
import eu.etaxonomy.cdm.api.service.idminter.RegistrationIdentifierMinter;
51 52
import eu.etaxonomy.cdm.api.service.taxonGraph.TaxonGraphBeforeTransactionCompleteProcess;
52 53
import eu.etaxonomy.cdm.cache.CdmTransientEntityCacher;
54
import eu.etaxonomy.cdm.config.CdmHibernateListener;
53 55
import eu.etaxonomy.cdm.dataInserter.RegistrationRequiredDataInserter;
54 56
import eu.etaxonomy.cdm.persistence.hibernate.GrantedAuthorityRevokingRegistrationUpdateLister;
55 57
import eu.etaxonomy.cdm.persistence.hibernate.ITaxonGraphHibernateListener;
......
84 86
@EnableVaadinSpringNavigation // activate the NavigationManagerBean
85 87
@EnableAnnotationBasedAccessControl // enable annotation based per view access control
86 88
@EnableEventBus // enable the vaadin spring event bus
89
@CdmHibernateListener // enable the configuration which activates the TaxonGraphHibernateListener bean
87 90
public class CdmVaadinConfiguration implements ApplicationContextAware  {
88 91

  
89 92
    public static final String CDM_VAADIN_UI_ACTIVATED = "cdm-vaadin.ui.activated";
......
103 106
    private ApplicationConfiguration appConfig;
104 107

  
105 108
    @Autowired
109
    @Qualifier("runAsAuthenticationProvider")
110
    private AuthenticationProvider runAsAuthenticationProvider;
111

  
112
    @Autowired
106 113
    private ITaxonGraphHibernateListener taxonGraphHibernateListener;
107 114

  
108 115
    @Autowired
......
189 196
            // TODO also POST_DELETE needed for GrantedAuthorityRevokingRegistrationUpdateLister?
190 197

  
191 198
            try {
192
                taxonGraphHibernateListener.registerProcessClass(TaxonGraphBeforeTransactionCompleteProcess.class, new Object[]{new RunAsAdmin()}, new Class[]{IRunAs.class});
199
                taxonGraphHibernateListener.registerProcessClass(TaxonGraphBeforeTransactionCompleteProcess.class, new Object[]{new RunAsAdmin(runAsAuthenticationProvider)}, new Class[]{IRunAs.class});
193 200
            } catch (NoSuchMethodException | SecurityException e) {
194 201
                // re-throw as RuntimeException as the context can not be created correctly
195 202
                throw new RuntimeException(e);

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)