繁体   English   中英

在Dynamics CRM中获取团队的背景

[英]Get the context of a team in dynamics crm

我在动态crm中有一个Temas列表,我希望在创建crm的上下文时仅具有一个团队的上下文,即该团队将无法访问其他团队的记录。

我试图像这样更改organizationproxy的callerID:

        //original context
        OrganizationServiceContext contextORI = new OrganizationServiceContext(organisationProxy);
        //i search th team
        team team= (from k in contextORI.CreateQuery<Utilisateur>()
                            where k.Id == TEAM.Id
                            select k).FirstOrDefault();
        //i change the caller of organisationProxy
        this.organisationProxy.CallerId = team .Id;
        //i create the new context
        OrganizationServiceContext context = new OrganizationServiceContext(organisationProxy);

但是团队始终可以获取所有结果

你有什么主意,我怎么能只有团队的背景呢?

这不会工作。

OrganizationServiceProxy.CallerId需要系统用户的ID。 https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.client.organizationserviceproxy.callerid.aspx

您可以模拟该团队的成员,并提供该用户和团队仅对您要查询的实体具有“用户/团队”读取访问权限,应适当过滤上下文。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM