當前位置: 首頁>>代碼示例>>Java>>正文


Java Env.getAD_Role_ID方法代碼示例

本文整理匯總了Java中org.compiere.util.Env.getAD_Role_ID方法的典型用法代碼示例。如果您正苦於以下問題:Java Env.getAD_Role_ID方法的具體用法?Java Env.getAD_Role_ID怎麽用?Java Env.getAD_Role_ID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.compiere.util.Env的用法示例。


在下文中一共展示了Env.getAD_Role_ID方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: toInfoString

import org.compiere.util.Env; //導入方法依賴的package包/類
private String toInfoString(final Properties ctx)
{
	final String threadName = (String)ctx.get(CTXNAME_ThreadName);
	final String threadId = (String)ctx.get(CTXNAME_ThreadId);
	final int adClientId = Env.getAD_Client_ID(ctx);
	final int adOrgId = Env.getAD_Org_ID(ctx);
	final int adUserId = Env.getAD_User_ID(ctx);
	final int adRoleId = Env.getAD_Role_ID(ctx);
	final int adSessionId = Env.getAD_Session_ID(ctx);

	return "Thread=" + threadName + "(" + threadId + ")"
			//
			+ "\n"
			+ ", Client/Org=" + adClientId + "/" + adOrgId
			+ ", User/Role=" + adUserId + "/" + adRoleId
			+ ", SessionId=" + adSessionId
			//
			+ "\n"
			+ ", id=" + System.identityHashCode(ctx)
			+ ", " + ctx.getClass()
			//
			+ "\n"
			+ ", " + ctx.toString();
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:25,代碼來源:TraceContextProviderListener.java

示例2: isAvailable

import org.compiere.util.Env; //導入方法依賴的package包/類
@Override
public boolean isAvailable()
{
	final Properties ctx = Env.getCtx();
	final VEditor editor = getEditor();
	final GridField gridField = editor.getField();

	// only system admins can change lists, so no need to zoom for others
	final int roleId = Env.getAD_Role_ID(ctx);
	if (gridField.getDisplayType() == DisplayType.List && roleId != 0)
	{
		return false;
	}

	if (editor instanceof IZoomableEditor)
	{
		return true;
	}

	if (!gridField.isLookup())
	{
		return false;
	}

	return true;
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:27,代碼來源:ZoomContextEditorAction.java

示例3: findPrintingService

import org.compiere.util.Env; //導入方法依賴的package包/類
public IPrintingService findPrintingService(final ProcessInfo pi)
{
	final Properties ctx = Env.getCtx();
	final int AD_Client_ID = Env.getAD_Client_ID(ctx);
	final int AD_Org_ID = Env.getAD_Org_ID(ctx);
	final int AD_Role_ID = Env.getAD_Role_ID(ctx);
	final int AD_User_ID = Env.getAD_User_ID(ctx);
	final int AD_Process_ID = pi.getAD_Process_ID();
	final int C_DocType_ID = Services.get(IDocumentBL.class).getC_DocType_ID(ctx, pi.getTable_ID(), pi.getRecord_ID());
	final String printerType = null;

	return findPrintingService0(ctx,
			AD_Client_ID, AD_Org_ID,
			AD_Role_ID, AD_User_ID,
			C_DocType_ID, AD_Process_ID,
			printerType);
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:18,代碼來源:PrinterRoutingBL.java

示例4: isLoginUserAdminForComSystem

import org.compiere.util.Env; //導入方法依賴的package包/類
private boolean isLoginUserAdminForComSystem(final Properties ctx, final I_C_AdvComSystem comSystem, final String trxName)
{

	boolean userIsAdmin = false;

	if (comSystem.getAD_User_Admin_ID() == Env.getAD_User_ID(ctx))
	{
		logger.debug("Login user " + Env.getAD_User_ID(ctx) + " is an admin for " + comSystem);
		userIsAdmin = true;
	}
	if (comSystem.getAD_Role_Admin_ID() == Env.getAD_Role_ID(ctx))
	{
		logger.debug("Login role " + Env.getAD_Role_ID(ctx) + " is an admin for " + comSystem);
		userIsAdmin = true;
	}

	return userIsAdmin;
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:19,代碼來源:SponsorCondition.java

示例5: buildCacheKey

import org.compiere.util.Env; //導入方法依賴的package包/類
private static final ArrayKey buildCacheKey(final Properties ctx)
{
	return new ArrayKey(
			Env.getAD_Client_ID(ctx),
			Env.getAD_Role_ID(ctx),
			Env.getAD_User_ID(ctx),
			Env.getAD_Language(ctx));
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:9,代碼來源:CacheCtxParamDescriptor.java

示例6: getAD_Role_ID

import org.compiere.util.Env; //導入方法依賴的package包/類
private int getAD_Role_ID()
{
	if (_adRoleId != null)
	{
		return _adRoleId;
	}

	final I_AD_PInstance adPInstance = getAD_PInstanceOrNull();
	if (adPInstance != null)
	{
		return adPInstance.getAD_Role_ID();
	}

	return Env.getAD_Role_ID(getCtx());
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:16,代碼來源:ProcessInfo.java

示例7: of

import org.compiere.util.Env; //導入方法依賴的package包/類
public static final UserRolePermissionsKey of(final Properties ctx)
{
	final int adRoleId = Env.getAD_Role_ID(ctx);
	final int adUserId = Env.getAD_User_ID(ctx);
	final int adClientId = Env.getAD_Client_ID(ctx);
	final Date date = Env.getDate(ctx);
	final long dateMillis = normalizeDate(date);
	return new UserRolePermissionsKey(adRoleId, adUserId, adClientId, dateMillis);
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:10,代碼來源:UserRolePermissionsKey.java

示例8: toPermissionsKeyString

import org.compiere.util.Env; //導入方法依賴的package包/類
public static final String toPermissionsKeyString(final Properties ctx)
{
	final int adRoleId = Env.getAD_Role_ID(ctx);
	final int adUserId = Env.getAD_User_ID(ctx);
	final int adClientId = Env.getAD_Client_ID(ctx);
	final Date date = Env.getDate(ctx);
	final long dateMillis = normalizeDate(date);
	return toPermissionsKeyString(adRoleId, adUserId, adClientId, dateMillis);
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:10,代碼來源:UserRolePermissionsKey.java

示例9: getAD_Role_ID

import org.compiere.util.Env; //導入方法依賴的package包/類
public int getAD_Role_ID()
{
	return Env.getAD_Role_ID(getCtx());
}
 
開發者ID:metasfresh,項目名稱:metasfresh-webui-api,代碼行數:5,代碼來源:InternalUserSessionData.java

示例10: get

import org.compiere.util.Env; //導入方法依賴的package包/類
/**
 * Get existing User Defined Windows for Role or User
 * @param ctx context
 * @param AD_Window_ID window ID
 * @return array of window customizations or empty array
 */
private static MUserDefWin[] get (Properties ctx, int AD_Window_ID)
{
	if (AD_Window_ID <= 0)
	{
		return NoWindows;
	}
	final int AD_Client_ID = Env.getAD_Client_ID(ctx);
	final int AD_Org_ID = Env.getAD_Org_ID(ctx);
	final int AD_User_ID = Env.getAD_User_ID(ctx);
	final int AD_Role_ID= Env.getAD_Role_ID(ctx);

	// Try from cache
	final ArrayKey key = new ArrayKey(AD_Window_ID, AD_Client_ID, AD_Org_ID, AD_User_ID, AD_Role_ID);
	MUserDefWin[] arr = s_cache.get(key);
	if (arr != null)
	{
		return arr;
	}

	// Load from DB
	final String whereClause = COLUMNNAME_AD_Window_ID+"=?"
						+" AND (AD_Client_ID=? OR AD_Client_ID=0)"
						+" AND (AD_Org_ID=? OR AD_Org_ID=0)"
						+" AND (AD_Role_ID=? OR AD_Role_ID IS NULL)"
						+" AND (AD_User_ID=? OR AD_User_ID IS NULL)";
	final List<MUserDefWin> list = new Query(ctx, Table_Name, whereClause, null)
		.setParameters(AD_Window_ID, AD_Client_ID, AD_Org_ID, AD_Role_ID, AD_User_ID)
		.setOnlyActiveRecords(true)
		.setOrderBy("AD_Client_ID, AD_Org_ID, COALESCE(AD_User_ID,0), COALESCE(AD_Role_ID,0)")
		.list();
	arr = list.toArray(new MUserDefWin[list.size()]);
	if (arr.length > 0)
	{
		s_cache.put(key, arr);
	}
	else
	{
		s_cache.put(key, NoWindows);
	}
	return arr;
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:48,代碼來源:MUserDefWin.java


注:本文中的org.compiere.util.Env.getAD_Role_ID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。