IDEMPIERE-1891 Cannot access Process message is hardcoded
This commit is contained in:
parent
d614c55eec
commit
840abd46ee
|
@ -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
|
||||||
|
;
|
|
@ -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
|
||||||
|
;
|
|
@ -27,6 +27,7 @@ import java.util.logging.Level;
|
||||||
|
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
|
import org.compiere.util.Msg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process Instance Model
|
* Process Instance Model
|
||||||
|
@ -207,8 +208,7 @@ public class MPInstance extends X_AD_PInstance
|
||||||
MRole role = MRole.get(getCtx(), AD_Role_ID);
|
MRole role = MRole.get(getCtx(), AD_Role_ID);
|
||||||
Boolean access = role.getProcessAccess(AD_Process_ID);
|
Boolean access = role.getProcessAccess(AD_Process_ID);
|
||||||
if (access == null || !access.booleanValue())
|
if (access == null || !access.booleanValue())
|
||||||
throw new IllegalAccessError("Cannot access Process " + AD_Process_ID
|
throw new IllegalAccessError(Msg.getMsg(getCtx(), "CannotAccessProcess", new Object[] {AD_Process_ID, role.getName()}));
|
||||||
+ " with role: " + role.getName());
|
|
||||||
}
|
}
|
||||||
super.setAD_Process_ID (AD_Process_ID);
|
super.setAD_Process_ID (AD_Process_ID);
|
||||||
} // setAD_Process_ID
|
} // setAD_Process_ID
|
||||||
|
|
Loading…
Reference in New Issue