diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java index fa03e6a439..75136f20c5 100644 --- a/org.adempiere.base/src/org/compiere/util/Env.java +++ b/org.adempiere.base/src/org/compiere/util/Env.java @@ -84,6 +84,7 @@ public final class Env public static final String AD_PRINTTABLEFORMAT_ID = "#AD_PrintTableFormat_ID"; public static final String AD_ROLE_ID = "#AD_Role_ID"; public static final String AD_ROLE_NAME = "#AD_Role_Name"; + public static final String AD_ROLE_TYPE = "#AD_Role_Type"; public static final String AD_SESSION_ID = "#AD_Session_ID"; public static final String AD_USER_ID = "#AD_User_ID"; public static final String AD_USER_NAME = "#AD_User_Name"; diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index e4504657ce..d5ddf22f15 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -469,7 +469,7 @@ public class Login ArrayList list = new ArrayList(); KeyNamePair[] retValue = null; String sql = "SELECT DISTINCT r.UserLevel, r.ConnectionProfile, " // 1/2 - + " c.AD_Client_ID,c.Name " // 3/4 + + " c.AD_Client_ID,c.Name,r.RoleType " // 3/4/5 + "FROM AD_Role r" + " INNER JOIN AD_Client c ON (r.AD_Client_ID=c.AD_Client_ID) " + "WHERE r.AD_Role_ID=?" // #1 @@ -493,6 +493,7 @@ public class Login // Role Info Env.setContext(m_ctx, Env.AD_ROLE_ID, role.getKey()); Env.setContext(m_ctx, Env.AD_ROLE_NAME, role.getName()); + Env.setContext(m_ctx, Env.AD_ROLE_TYPE, rs.getString("RoleType")); Ini.setProperty(Ini.P_ROLE, role.getName()); // User Level Env.setContext(m_ctx, Env.USER_LEVEL, rs.getString(1)); // Format 'SCO' @@ -546,7 +547,7 @@ public class Login ArrayList list = new ArrayList(); KeyNamePair[] retValue = null; // - String sql = " SELECT DISTINCT r.UserLevel, r.ConnectionProfile,o.AD_Org_ID,o.Name,o.IsSummary " + String sql = " SELECT DISTINCT r.UserLevel, r.ConnectionProfile,o.AD_Org_ID,o.Name,o.IsSummary,r.RoleType " +" FROM AD_Org o" +" INNER JOIN AD_Role r on (r.AD_Role_ID=?)" +" INNER JOIN AD_Client c on (c.AD_Client_ID=?)" @@ -579,6 +580,7 @@ public class Login // Role Info Env.setContext(m_ctx, Env.AD_ROLE_ID, rol.getKey()); Env.setContext(m_ctx, Env.AD_ROLE_NAME, rol.getName()); + Env.setContext(m_ctx, Env.AD_ROLE_TYPE, rs.getString("RoleType")); Ini.setProperty(Ini.P_ROLE, rol.getName()); // User Level Env.setContext(m_ctx, Env.USER_LEVEL, rs.getString(1)); // Format 'SCO' diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index eaed371870..3f0ce553d7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -590,6 +590,7 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb Env.setContext(properties, Env.AD_USER_NAME, Env.getContext(Env.getCtx(), Env.AD_USER_NAME)); Env.setContext(properties, Env.AD_ROLE_ID, Env.getAD_Role_ID(Env.getCtx())); Env.setContext(properties, Env.AD_ROLE_NAME, Env.getContext(Env.getCtx(), Env.AD_ROLE_NAME)); + Env.setContext(properties, Env.AD_ROLE_TYPE, Env.getContext(Env.getCtx(), Env.AD_ROLE_TYPE)); Env.setContext(properties, Env.USER_LEVEL, Env.getContext(Env.getCtx(), Env.USER_LEVEL)); Env.setContext(properties, Env.AD_ORG_NAME, Env.getContext(Env.getCtx(), Env.AD_ORG_NAME)); Env.setContext(properties, Env.M_WAREHOUSE_ID, Env.getContext(Env.getCtx(), Env.M_WAREHOUSE_ID));