Script ModelValidatorLogin

From iDempiere en
Revision as of 21:24, 23 July 2013 by CarlosRuiz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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

Cookies help us deliver our services. By using our services, you agree to our use of cookies.