diff --git a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java index 19d431cb13..3cb5124094 100644 --- a/org.adempiere.base/src/org/compiere/model/MInfoWindow.java +++ b/org.adempiere.base/src/org/compiere/model/MInfoWindow.java @@ -42,7 +42,7 @@ public class MInfoWindow extends X_AD_InfoWindow /** * */ - private static final long serialVersionUID = -3099366897275960300L; + private static final long serialVersionUID = -3627504150648422756L; /** * Standard Constructor @@ -178,6 +178,15 @@ public class MInfoWindow extends X_AD_InfoWindow } + /** return true if the current role can access to the specified info window ; otherwise return null */ + public static MInfoWindow get(int infoWindowID, String trxName) { + MInfoWindow iw = new MInfoWindow(Env.getCtx(), infoWindowID, null); + Boolean access = MRole.getDefault().getInfoAccess(iw.getAD_InfoWindow_ID()); + if (access != null && access.booleanValue()) + return iw; + return null; + } + public MInfoColumn[] getInfoColumns(TableInfo[] tableInfos) { Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName()); List list = query.setParameters(getAD_InfoWindow_ID()) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java index b9188cb3b4..8cd4ab2b26 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/dashboard/DPViews.java @@ -24,7 +24,6 @@ import org.adempiere.webui.window.InfoSchedule; import org.compiere.model.MInfoWindow; import org.compiere.model.MRole; import org.compiere.model.MSysConfig; -import org.compiere.model.MTable; import org.compiere.model.Query; import org.compiere.util.Env; import org.compiere.util.Msg; @@ -90,7 +89,7 @@ public class DPViews extends DashboardPanel implements EventListener { for (int i = 0; i < infos.length; i++) { MInfoWindow info = infos[i]; - if (MInfoWindow.get(MTable.getTableName(Env.getCtx(), info.getAD_Table_ID()), null) != null) + if (MInfoWindow.get(info.getAD_InfoWindow_ID(), null) != null) { ToolBarButton btnViewItem = new ToolBarButton(info.getName()); btnViewItem.setSclass("link");