IDEMPIERE-1859 Info Window access are based on the table and not on the InfoWindowID
This commit is contained in:
parent
b825c289b4
commit
6ca4902204
|
@ -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
|
* 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) {
|
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());
|
Query query = new Query(getCtx(), MTable.get(getCtx(), I_AD_InfoColumn.Table_ID), I_AD_InfoColumn.COLUMNNAME_AD_InfoWindow_ID+"=?", get_TrxName());
|
||||||
List<MInfoColumn> list = query.setParameters(getAD_InfoWindow_ID())
|
List<MInfoColumn> list = query.setParameters(getAD_InfoWindow_ID())
|
||||||
|
|
|
@ -24,7 +24,6 @@ import org.adempiere.webui.window.InfoSchedule;
|
||||||
import org.compiere.model.MInfoWindow;
|
import org.compiere.model.MInfoWindow;
|
||||||
import org.compiere.model.MRole;
|
import org.compiere.model.MRole;
|
||||||
import org.compiere.model.MSysConfig;
|
import org.compiere.model.MSysConfig;
|
||||||
import org.compiere.model.MTable;
|
|
||||||
import org.compiere.model.Query;
|
import org.compiere.model.Query;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
|
@ -90,7 +89,7 @@ public class DPViews extends DashboardPanel implements EventListener<Event> {
|
||||||
for (int i = 0; i < infos.length; i++)
|
for (int i = 0; i < infos.length; i++)
|
||||||
{
|
{
|
||||||
MInfoWindow info = infos[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());
|
ToolBarButton btnViewItem = new ToolBarButton(info.getName());
|
||||||
btnViewItem.setSclass("link");
|
btnViewItem.setSclass("link");
|
||||||
|
|
Loading…
Reference in New Issue