当前位置: 首页>>代码示例>>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;未经允许,请勿转载。