Script ModelValidatorLogin

From iDempiere en

Just Create the Rule

Within the script you can use the following predefined variables:

  • A_Ctx
  • A_AD_Client_ID
  • A_AD_Org_ID
  • A_AD_Role_ID
  • A_AD_User_ID

01 ScriptForModelValidatorLogin.png

Code provided for copy/paste testing

On the Rule Search Key:

groovy:DontAllowGardenAdmin

On the Rule Script:

import org.compiere.model.MUser;

MUser user = new MUser(A_Ctx, A_AD_User_ID, null);
if (user.getName().equals("GardenAdmin"))
    msg = "GardenAdmin is banned from this installation";
else
    msg = ""; 

result = msg;

See Also