IDEMPIERE-4268 Web Services : Read miss cross-tenant check (#456)
Extracting from @hengsin pull request 453
This commit is contained in:
parent
f2c5ec429b
commit
9d6de521f2
|
@ -36,6 +36,7 @@ public class MUserDefWin extends X_AD_UserDef_Win implements ImmutablePOSupport
|
|||
*/
|
||||
private static final long serialVersionUID = -7542708120229671875L;
|
||||
private volatile static List<MUserDefWin> m_fullList = null;
|
||||
private static final Object m_fullListLock = new Object();
|
||||
|
||||
/**
|
||||
* Standard constructor.
|
||||
|
@ -103,6 +104,7 @@ public class MUserDefWin extends X_AD_UserDef_Win implements ImmutablePOSupport
|
|||
*/
|
||||
private static MUserDefWin[] getAll (Properties ctx, int window_ID )
|
||||
{
|
||||
synchronized (m_fullListLock) {
|
||||
if (m_fullList == null) {
|
||||
try {
|
||||
PO.setCrossTenantSafe();
|
||||
|
@ -113,6 +115,7 @@ public class MUserDefWin extends X_AD_UserDef_Win implements ImmutablePOSupport
|
|||
PO.clearCrossTenantSafe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_fullList.size() == 0) {
|
||||
return null;
|
||||
|
|
|
@ -209,7 +209,7 @@ public abstract class PO
|
|||
else
|
||||
load(ID, trxName);
|
||||
|
||||
checkValidClient(false);
|
||||
checkCrossTenant(false);
|
||||
} // PO
|
||||
|
||||
/**
|
||||
|
@ -2082,7 +2082,7 @@ public abstract class PO
|
|||
checkImmutable();
|
||||
|
||||
checkValidContext();
|
||||
checkValidClient(true);
|
||||
checkCrossTenant(true);
|
||||
CLogger.resetLast();
|
||||
boolean newRecord = is_new(); // save locally as load resets
|
||||
if (!newRecord && !is_Changed())
|
||||
|
@ -3270,7 +3270,7 @@ public abstract class PO
|
|||
checkImmutable();
|
||||
|
||||
checkValidContext();
|
||||
checkValidClient(true);
|
||||
checkCrossTenant(true);
|
||||
CLogger.resetLast();
|
||||
if (is_new())
|
||||
return true;
|
||||
|
@ -5002,7 +5002,7 @@ public abstract class PO
|
|||
isSafeCrossTenant.set(Boolean.FALSE);
|
||||
}
|
||||
|
||||
private void checkValidClient(boolean writing) {
|
||||
private void checkCrossTenant(boolean writing) {
|
||||
if (isSafeCrossTenant.get())
|
||||
return;
|
||||
int envClientID = Env.getAD_Client_ID(getCtx());
|
||||
|
|
Loading…
Reference in New Issue