import org.eclipse.swt.widgets.Shell;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
-import eu.etaxonomy.cdm.model.permission.Operation;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
import eu.etaxonomy.taxeditor.editor.AppModelId;
import eu.etaxonomy.taxeditor.editor.EditorUtil;
*/
@Override
protected boolean canExecute(TaxonNode entity) {
- boolean hasPermission = CdmStore.currentAuthentiationHasPermission(entity, Operation.UPDATE);
- return hasPermission && entity.getTaxon()!=null ;
+ return entity.getTaxon()!=null ;
+// boolean hasPermission = CdmStore.currentAuthentiationHasPermission(entity, Operation.UPDATE);
+// return hasPermission && entity.getTaxon()!=null ;
}
@Override
}
public void init(UUID parentTaxonUuid) {
- this.taxonList = CdmStore.getService(ITaxonNodeService.class).getTaxonDistributionDTOForSubtree(parentTaxonUuid, TAXONNODE_PROPERTY_PATH, CdmStore.getCurrentAuthentiation());
+ this.taxonList = CdmStore.getService(ITaxonNodeService.class).getTaxonDistributionDTOForSubtree(parentTaxonUuid, TAXONNODE_PROPERTY_PATH, null);
// taxonList.stream().filter(taxonDistribution -> CdmStore.currentAuthentiationHasPermission(taxonDistribution.getTaxonUuid(), RequiredPermissions.TAXONNODE_EDIT));
if (!hasDescriptionPermission){
return false;
}
- boolean hasPermission = ((TaxonNode)entity).hasChildNodes() ? checkPermission(((TaxonNode)entity).getChildNodes(), false) || CdmStore.currentAuthentiationHasPermission(((TaxonNode) entity), RequiredPermissions.TAXONNODE_EDIT):CdmStore.currentAuthentiationHasPermission(((TaxonNode) entity), RequiredPermissions.TAXONNODE_EDIT);
- return hasPermission && PreferencesUtil.getBooleanValue(PreferencePredicate.DistributionEditorActivated.getKey());
+ return PreferencesUtil.getBooleanValue(PreferencePredicate.DistributionEditorActivated.getKey());
+ //check whether the user has subtree rights
+ // CdmStore.getCurrentAuthentiation().getAuthorities()
+ // boolean hasPermission = ((TaxonNode)entity).hasChildNodes() ? checkPermission(((TaxonNode)entity).getChildNodes(), false) || CdmStore.currentAuthentiationHasPermission(((TaxonNode) entity), RequiredPermissions.TAXONNODE_EDIT):CdmStore.currentAuthentiationHasPermission(((TaxonNode) entity), RequiredPermissions.TAXONNODE_EDIT);
+ // return hasPermission && PreferencesUtil.getBooleanValue(PreferencePredicate.DistributionEditorActivated.getKey());
}
@Override
@Override
protected void updateControlStates(){
- super.updateControlStates();
+
updateToggleableCacheState();
+ super.updateControlStates();
}
}
protected void showViewer(IStructuredSelection selection, MPart activePart, Viewer viewer){
+
if(viewer!=null && viewer.getControl()!=null && !viewer.getControl().isDisposed()){
Object element = selection.getFirstElement();
Object part = createPartObject(activePart);
if (node != null){
boolean doEnable = CdmStore.currentAuthentiationHasPermission(node,
RequiredPermissions.TAXON_EDIT);
- this.isEnabled = doEnable;
+ //TODO: differ between the views
+ //this.isEnabled = doEnable;
}