- removed StoreUtil.getCdmEntity() invocation (#4091)
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 17 Mar 2014 08:43:08 +0000 (08:43 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 17 Mar 2014 08:43:08 +0000 (08:43 +0000)
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/AbstractIdentifiableEntityDetailElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EntitySelectionElement.java

index 94e7b8f1c7633c448b21f18e436ffef44b71fa5a..eddf15d587a1a3dea682a023fa3b7796835a7856 100644 (file)
@@ -21,6 +21,7 @@ import org.eclipse.ui.navigator.IDescriptionProvider;
 import org.hibernate.LazyInitializationException;
 
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
 import eu.etaxonomy.cdm.model.taxon.TaxonNode;
@@ -96,7 +97,7 @@ public class TaxonNodeLabelProvider extends ColumnLabelProvider
     public StyledString getStyledText(Object element) {
                // determine style base on  user grants
                Styler styler = null;
-               if(!CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(element), RequiredPermissions.TAXONNODE_EDIT)){
+               if(!CdmStore.currentAuthentiationHasPermission((CdmBase) element, RequiredPermissions.TAXONNODE_EDIT)){
                        styler = getNotGrantedStyler();
                }
                return new StyledString(getText(element), styler);
index 36bb1fe011cf1f35e7e51243ff1e3833da8c98ff..2541c85bd437284f6360dc746fc2f784b4e75b1e 100644 (file)
@@ -6,10 +6,10 @@ package eu.etaxonomy.taxeditor.ui.section;
 import java.util.Arrays;
 import java.util.EnumSet;
 
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
 import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.store.StoreUtil;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
@@ -57,7 +57,7 @@ public abstract class AbstractIdentifiableEntityDetailElement<T extends IIdentif
 
     private void updateToggleableCacheState() {
         if(toggleable_cache != null){
-            toggleable_cache.setEnabled(getEntity() != null && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), UPDATE));
+            toggleable_cache.setEnabled(getEntity() != null && CdmStore.currentAuthentiationHasPermission((CdmBase) getEntity(), UPDATE));
         }
     }
 
index 1bd8ca05bdb1aec9e8b33572ee5be243288e7260..387bae537643e0b4e4c8a63e1f650cb1bc31db1d 100644 (file)
@@ -24,6 +24,7 @@ import org.springframework.security.core.GrantedAuthority;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Group;
 import eu.etaxonomy.cdm.model.common.ICdmBase;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
@@ -485,7 +486,7 @@ public class EntitySelectionElement<T extends ICdmBase> extends
 
        private void updateButtonStates() {
            if(button_edit != null && !button_selection.isDisposed()){
-               button_edit.setEnabled(isEditable && button_selection.isEnabled() && getEntity() != null  && CdmStore.currentAuthentiationHasPermission(StoreUtil.getCdmEntity(getEntity()), UPDATE));
+               button_edit.setEnabled(isEditable && button_selection.isEnabled() && getEntity() != null  && CdmStore.currentAuthentiationHasPermission((CdmBase) getEntity(), UPDATE));
            }
        }
 }