Project

General

Profile

« Previous | Next » 

Revision 37f70555

Added by Andreas Kohlbecker almost 6 years ago

ref #7550 moving the actual CdmUserHelper to cdmlib and making it available in cdm-vaadin by extending the UserHelper class and interface hierarchy

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItemNameAndTypeButtons.java
33 33
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
34 34
import eu.etaxonomy.cdm.vaadin.component.ButtonFactory;
35 35
import eu.etaxonomy.cdm.vaadin.permission.PermissionDebugUtils;
36
import eu.etaxonomy.cdm.vaadin.permission.UserHelper;
36
import eu.etaxonomy.cdm.vaadin.permission.VaadinUserHelper;
37 37
import eu.etaxonomy.vaadin.component.CompositeStyledComponent;
38 38

  
39 39
/**
......
78 78
            nameIdButton = new IdButton<TaxonName>(TaxonName.class, regDto.getNameRef().getUuid(), nameButton);
79 79
            Label nameLabel = new Label(regDto.getNameRef().getLabel());
80 80
            nameLabel.setWidthUndefined();
81
            boolean userHasPermission = UserHelper.fromSession().userHasPermission(regDto.registration().getName(), CRUD.UPDATE);
81
            boolean userHasPermission = VaadinUserHelper.fromSession().userHasPermission(regDto.registration().getName(), CRUD.UPDATE);
82 82
            nameButton.setReadOnly(isRegistrationLocked || ! userHasPermission);
83 83

  
84 84
            addComponent(nameIdButton.getButton());
......
92 92
                addComponent(nameLabel);
93 93
            }
94 94
        }
95
        boolean userHasAddPermission = UserHelper.fromSession().userHasPermission(Registration.class, regDto.getUuid(), CRUD.UPDATE);
95
        boolean userHasAddPermission = VaadinUserHelper.fromSession().userHasPermission(Registration.class, regDto.getUuid(), CRUD.UPDATE);
96 96
        if(regDto.getOrderdTypeDesignationWorkingSets() != null){
97 97
            for(TypedEntityReference<TypeDesignationBase<?>> baseEntityRef : regDto.getOrderdTypeDesignationWorkingSets().keySet()) {
98 98
                TypeDesignationWorkingSet typeDesignationWorkingSet = regDto.getOrderdTypeDesignationWorkingSets().get(baseEntityRef);
......
100 100
                String buttonLabel = SpecimenOrObservationBase.class.isAssignableFrom(baseEntityRef.getType()) ? "Type": "NameType";
101 101
                Button tdButton = new Button(buttonLabel + ":");
102 102
                tdButton.setDescription("Edit the type designation working set");
103
                boolean userHasUpdatePermission = UserHelper.fromSession().userHasPermission(baseEntityRef.getType(), baseEntityRef.getUuid(), CRUD.UPDATE, CRUD.DELETE);
103
                boolean userHasUpdatePermission = VaadinUserHelper.fromSession().userHasPermission(baseEntityRef.getType(), baseEntityRef.getUuid(), CRUD.UPDATE, CRUD.DELETE);
104 104
                tdButton.setReadOnly(isRegistrationLocked || !userHasUpdatePermission);
105 105
                addComponent(tdButton);
106 106

  

Also available in: Unified diff