private final void importViewsAfterCheck(final TreeNode node) {
XUser user = ((Workbench)Registry.get(Workbench.ID)).getUser();
int permission = user.isAdmin() ? 0 : 16;
WPaloCubeViewServiceProvider.getInstance().checkPermission(user.getSessionId(), permission, new AsyncCallback <Boolean>(){
private final void showDialog(boolean showBoxes) {
final ViewImportDialog importDlg = new ViewImportDialog(true, showBoxes);
importDlg.addButtonListener(ViewImportDialog.BUTTON_OK,
new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
XView[] xViews = importDlg.getSelectedViews();
TreeNode parent = getParentFolder(node);
importViews(constants.importingViews(), xViews, parent, importDlg
.isPublic(), importDlg.isEditable());
}
});
importDlg.show();
}
public void onFailure(Throwable t) {
showDialog(false);
}