Script ModelValidatorLogin

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.

Status: working in version > 3.3.1b

Contributed by:
Quality Systems & Solutions - QSS Ltda.
Carlos Ruiz


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:

beanshell:DontAllowGardenAdmin

On the Rule Script:

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

resultado = retorno;

See Also