Fix IDEMPIERE-111 Admin role can delete System records !!!

http://jira.idempiere.com/browse/IDEMPIERE-111
Thanks a lot to Nicolas (nmicoud) for the testings reported at
http://red1.org/adempiere/viewtopic.php?f=31&t=1478&p=7201#p7201
This commit is contained in:
Carlos Ruiz 2012-01-16 17:39:16 -05:00
parent 8737983434
commit af7d034610
1 changed files with 3 additions and 6 deletions

View File

@ -2553,8 +2553,8 @@ public class GridTable extends AbstractTableModel
// Carlos Ruiz - globalqss - IDEMPIERE-111
// Check if the role has access to this client
// Can we change?
int[] co = getClientOrg(m_rowChanged);
int AD_Client_ID = co[0];
int[] co = getClientOrg(row);
int AD_Client_ID = co[0];
int AD_Org_ID = co[1];
if (!MRole.getDefault(m_ctx, false).canUpdate(AD_Client_ID, AD_Org_ID, m_AD_Table_ID, 0, true))
{
@ -2562,15 +2562,12 @@ public class GridTable extends AbstractTableModel
return false;
}
/** @todo check Access */
// fireDataStatusEvent(Log.retrieveError());
MSort sort = (MSort)m_sort.get(row);
Object[] rowData = getDataAtRow(row);
//
MTable table = MTable.get (m_ctx, m_AD_Table_ID);
PO po = null;
int Record_ID = getKeyID(m_rowChanged);
int Record_ID = getKeyID(row);
if (Record_ID != -1)
po = table.getPO(Record_ID, null);
else // Multi - Key