简体   繁体   English

在Dynamics CRM中获取团队的背景

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

I have a list of temas in dynamics crm, I want when I create the context of crm will have only the context of one team, ie the team will not have the access to records of other teams. 我在动态crm中有一个Temas列表,我希望在创建crm的上下文时仅具有一个团队的上下文,即该团队将无法访问其他团队的记录。

I have try to change the callerID of the organizationproxy like this: 我试图像这样更改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);

But the team have always the access to all results 但是团队始终可以获取所有结果

Do you have any idea how can I have only the context of the team ? 你有什么主意,我怎么能只有团队的背景呢?

This wont work. 这不会工作。

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

You could impersonate a member of that team and provided the user and team only have User/Team read access against the entity you are querying the context should be appropriately filtered. 您可以模拟该团队的成员,并提供该用户和团队仅对您要查询的实体具有“用户/团队”读取访问权限,应适当过滤上下文。

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

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