manage panel hide when user is not admin nor vre manager

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@158045 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2017-10-31 11:17:44 +00:00
parent d317dcf8fe
commit 9d9f548eb3
2 changed files with 24 additions and 1 deletions

View File

@ -1,6 +1,8 @@
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
import org.gcube.datacatalogue.grsf_manage_widget.client.events.HideManagementPanelEvent;
import org.gcube.datacatalogue.grsf_manage_widget.client.events.HideManagementPanelEventHandler;
import org.gcube.datacatalogue.grsf_manage_widget.client.view.ManageProductWidget;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEvent;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEventHandler;
@ -216,7 +218,7 @@ public class CkanEventHandlerManager {
@Override
public void onShowManageProductWidget(ShowManageProductWidgetEvent event) {
new ManageProductWidget(event.getProductIdentifier());
new ManageProductWidget(event.getProductIdentifier(), eventBus);
}
});
@ -229,6 +231,17 @@ public class CkanEventHandlerManager {
}
});
// hide management panel if user is not allowed to manage
eventBus.addHandler(HideManagementPanelEvent.TYPE, new HideManagementPanelEventHandler() {
@Override
public void onEvent(HideManagementPanelEvent hideEvent) {
panel.showManagementPanel(false);
}
});
}
/**

View File

@ -487,4 +487,14 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
ckanOrganizationsPanel.setVisible(false);
ckanFramePanel.setVisible(false);
}
/**
* Show management panel
* @param show
*/
public void showManagementPanel(boolean show){
managementPanel.showManageProductButton(show);
}
}