[英]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.