From 840abd46ee0e9d298f5388d5b40fe84c52ae1163 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Sun, 20 Apr 2014 14:54:52 -0500 Subject: [PATCH] IDEMPIERE-1891 Cannot access Process message is hardcoded --- migration/i2.0/oracle/201404081520_IDEMPIERE-1891.sql | 10 ++++++++++ .../i2.0/postgresql/201404081520_IDEMPIERE-1891.sql | 7 +++++++ .../src/org/compiere/model/MPInstance.java | 4 ++-- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 migration/i2.0/oracle/201404081520_IDEMPIERE-1891.sql create mode 100644 migration/i2.0/postgresql/201404081520_IDEMPIERE-1891.sql diff --git a/migration/i2.0/oracle/201404081520_IDEMPIERE-1891.sql b/migration/i2.0/oracle/201404081520_IDEMPIERE-1891.sql new file mode 100644 index 0000000000..7eba276e24 --- /dev/null +++ b/migration/i2.0/oracle/201404081520_IDEMPIERE-1891.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Apr 8, 2014 3:18:45 PM CEST +-- IDEMPIERE-1891 +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200269,'0b36ffa9-8364-4d93-8d9a-1e3eae4aa81b',0,TO_DATE('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','You cannot access process {0} with your role : {1}','I',TO_DATE('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'CannotAccessProcess') +; + +SELECT register_migration_script('201404081520_IDEMPIERE-1891.sql') FROM dual +; diff --git a/migration/i2.0/postgresql/201404081520_IDEMPIERE-1891.sql b/migration/i2.0/postgresql/201404081520_IDEMPIERE-1891.sql new file mode 100644 index 0000000000..e3920d4303 --- /dev/null +++ b/migration/i2.0/postgresql/201404081520_IDEMPIERE-1891.sql @@ -0,0 +1,7 @@ +-- Apr 8, 2014 3:18:45 PM CEST +-- IDEMPIERE-1891 +INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Message_UU,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,200269,'0b36ffa9-8364-4d93-8d9a-1e3eae4aa81b',0,TO_TIMESTAMP('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','You cannot access process {0} with your role : {1}','I',TO_TIMESTAMP('2014-04-08 15:18:44','YYYY-MM-DD HH24:MI:SS'),100,'CannotAccessProcess') +; + +SELECT register_migration_script('201404081520_IDEMPIERE-1891.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/compiere/model/MPInstance.java b/org.adempiere.base/src/org/compiere/model/MPInstance.java index 6909333f64..1aa488042e 100644 --- a/org.adempiere.base/src/org/compiere/model/MPInstance.java +++ b/org.adempiere.base/src/org/compiere/model/MPInstance.java @@ -27,6 +27,7 @@ import java.util.logging.Level; import org.compiere.util.DB; import org.compiere.util.Env; +import org.compiere.util.Msg; /** * Process Instance Model @@ -207,8 +208,7 @@ public class MPInstance extends X_AD_PInstance MRole role = MRole.get(getCtx(), AD_Role_ID); Boolean access = role.getProcessAccess(AD_Process_ID); if (access == null || !access.booleanValue()) - throw new IllegalAccessError("Cannot access Process " + AD_Process_ID - + " with role: " + role.getName()); + throw new IllegalAccessError(Msg.getMsg(getCtx(), "CannotAccessProcess", new Object[] {AD_Process_ID, role.getName()})); } super.setAD_Process_ID (AD_Process_ID); } // setAD_Process_ID