IDEMPIERE-5849 MRole.getDefault make phantom role on cache (#2149)
- Make SysConfigurable to return System role for backward compatibility
This commit is contained in:
parent
03ceb5f88f
commit
4f52a4efcf
|
@ -87,8 +87,10 @@ public final class MRole extends X_AD_Role implements ImmutablePOSupport
|
|||
*/
|
||||
public static MRole getDefault (Properties ctx, boolean reload)
|
||||
{
|
||||
if (Util.isEmpty(Env.getContext(ctx, Env.AD_ROLE_ID)) || Util.isEmpty(Env.getContext(ctx, Env.AD_USER_ID)))
|
||||
return null;
|
||||
if (MSysConfig.getBooleanValue(MSysConfig.MROLE_GETDEFAULT_RETURNS_NULL_WHEN_NO_CONTEXT, true)) {
|
||||
if (Util.isEmpty(Env.getContext(ctx, Env.AD_ROLE_ID)) || Util.isEmpty(Env.getContext(ctx, Env.AD_USER_ID)))
|
||||
return null;
|
||||
}
|
||||
|
||||
int AD_Role_ID = Env.getContextAsInt(ctx, Env.AD_ROLE_ID);
|
||||
int AD_User_ID = Env.getContextAsInt(ctx, Env.AD_USER_ID);
|
||||
|
|
|
@ -42,9 +42,9 @@ import org.compiere.util.Util;
|
|||
public class MSysConfig extends X_AD_SysConfig
|
||||
{
|
||||
/**
|
||||
* generated serial id
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -8121703411463724745L;
|
||||
private static final long serialVersionUID = 1548573102245466450L;
|
||||
|
||||
/** Constant for Predefine System Configuration Names (in alphabetical order) */
|
||||
|
||||
|
@ -155,6 +155,7 @@ public class MSysConfig extends X_AD_SysConfig
|
|||
public static final String MFG_ValidateCostsOnCreate = "MFG_ValidateCostsOnCreate";
|
||||
public static final String MONITOR_INITIAL_WAIT_FOR_CLUSTER_IN_SECONDS = "MONITOR_INITIAL_WAIT_FOR_CLUSTER_IN_SECONDS";
|
||||
public static final String MONITOR_MAX_WAIT_FOR_CLUSTER_IN_SECONDS = "MONITOR_MAX_WAIT_FOR_CLUSTER_IN_SECONDS";
|
||||
public static final String MROLE_GETDEFAULT_RETURNS_NULL_WHEN_NO_CONTEXT = "MROLE_GETDEFAULT_RETURNS_NULL_WHEN_NO_CONTEXT";
|
||||
public static final String MSEQUENCE_GETNEXT_TIMEOUT = "MSEQUENCE_GETNEXT_TIMEOUT";
|
||||
public static final String ORDER_COLUMNS_TO_COPY_TO_NOT_COMPLETED_INVOICES = "ORDER_COLUMNS_TO_COPY_TO_NOT_COMPLETED_INVOICES";
|
||||
public static final String PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT = "PAYMENT_OVERWRITE_DOCUMENTNO_WITH_CHECK_ON_PAYMENT";
|
||||
|
|
Loading…
Reference in New Issue