IDEMPIERE-1891 Cannot access Process message is hardcoded

This commit is contained in:
Nicolas Micoud 2014-04-20 14:54:52 -05:00
parent d614c55eec
commit 840abd46ee
3 changed files with 19 additions and 2 deletions

View File

@ -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
;

View File

@ -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
;

View File

@ -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