IDEMPIERE-4268 Web Services : Read miss cross-tenant check (#470)

Fix cross-tenant problem about forcing to change a password expired in a multi-tenant environment
This commit is contained in:
Carlos Ruiz 2020-12-16 11:38:53 +01:00 committed by GitHub
parent a9a2aeeeed
commit 1ca179f121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -37,6 +37,7 @@ import org.compiere.model.MPasswordHistory;
import org.compiere.model.MPasswordRule;
import org.compiere.model.MSysConfig;
import org.compiere.model.MUser;
import org.compiere.model.PO;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
@ -356,7 +357,12 @@ public class ChangePasswordPanel extends Window implements EventListener<Event>
user.setIsExpired(false);
user.setSecurityQuestion(securityQuestion);
user.setAnswer(answer);
user.saveEx(trx.getTrxName());
try {
PO.setCrossTenantSafe();
user.saveEx(trx.getTrxName());
} finally {
PO.clearCrossTenantSafe();
}
}
trx.commit();