当前位置:网站首页>Dynamics crm: sharing records for users and teams
Dynamics crm: sharing records for users and teams
2022-07-24 15:39:00 【Stone-hdj】
stay C# in , The following three classes may be used to share records for users and teams :
| GrantAccessRequest | Share a record as not before share Users or teams who have this record |
| ModifyAccessRequest | Modify share permissions , For previously share Records for users or teams |
| RevokeAccessRequest | Cancel the sharing permission of a user or team on a record |
GrantAccessRequest
Variable accountRef For records that need to be shared
Variable teamRef For the team to share
var accouontRef = new EntityReference(Account.EntityLogicalName, _accountId);
var teamRef = new EntityReference(Team.EntityLogicalName, _teamId);
var grantAccessRequest = new GrantAccessRequest
{
PrincipalAccess = new PrincipalAccess
{
// Give reading , Write and delete permissions
AccessMask = AccessRights.ReadAccess | AccessRights.WriteAccess | AccessRights.DeleteAccess,
Principal = teamRef
},
Target = accouontRef
};
_serviceProxy.Execute(grantAccessRequest);ModifyAccessRequest
Variable accountRef For records that need to be shared
Variable teamRef For the team to share
var accouontRef = new EntityReference(Account.EntityLogicalName, _accountId);
var teamRef = new EntityReference(Team.EntityLogicalName, _teamId);
var modifyUser1AccessReq = new ModifyAccessRequest
{
PrincipalAccess = new PrincipalAccess
{
// Give delete and additional permissions
AccessMask = AccessRights.DeleteAccess | AccessRights.AppendAccess,
Principal = teamRef
},
Target = accouontRef
};
_serviceProxy.Execute(modifyUser1AccessReq);RevokeAccessRequest
Variable accountRef For records that need to be shared
Variable teamRef For the team to share
var accouontRef = new EntityReference(Account.EntityLogicalName, _accountId);
var teamRef = new EntityReference(Team.EntityLogicalName, _teamId);
var revokeUserAccessReq = new RevokeAccessRequest
{
Revokee = teamRef,
Target = accouontRef
};
_serviceProxy.Execute(revokeUserAccessReq);Note:
- Use ModifyAccessRequest Permission cannot be empty , That is, you don't have any permissions , Even if it is empty , The system will also retain a read permission . So if you want a user or team to have no permissions on a record , Use it directly RevokeAccessRequest Let's remove permissions
Reference resources :
Sample: Share records using GrantAccess, ModifyAccess and RevokeAccess messages (Developer Guide for Dynamics 365 Customer Engagement (on-premises)) | Microsoft Docs
https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/sample-share-records-using-grantaccess-modifyaccess-revokeaccess-messages?view=op-9-1AccessRights Enum (Microsoft.Crm.Sdk.Messages) | Microsoft Docs
https://docs.microsoft.com/en-us/dotnet/api/microsoft.crm.sdk.messages.accessrights?view=dataverse-sdk-latest
边栏推荐
- [300 opencv routines] 238. Harris corner detection in opencv
- 华为无线设备配置WAPI-证书安全策略
- PyTorch的自动求导
- Five principles of solid are indispensable for good architecture design
- You can't just focus on flex layout and elaborate animation to explain all flex layout methods! Easy to understand dry goods tutorial
- 未来数据库需要关心的硬核创新
- iptables常用命令小清单
- 2022 RoboCom 世界机器人开发者大赛-本科组(省赛)RC-u4 攻略分队 (已完结)
- 3、 Set foundation ArrayList set and simple student management system
- Android SQLite database practice
猜你喜欢

Android section 13 detailed explanation of 03sqlite database

遭受DDoS时,高防IP和高防CDN的选择

什么是防火墙?防火墙能发挥什么样的作用?

维护香港服务器安全的9个关键措施

MySQL build master-slave synchronization - build with docker

Configuring WAPI certificate security policy for Huawei wireless devices

Force button 31. Next arrangement -- double finger needling

2022 RoboCom 世界机器人开发者大赛-本科组(省赛)---第一题 不要浪费金币 (已完结)

基于Lambert函数的时滞系统稳定性研究

【AdaptiveAvgPool3d】pytorch教程
随机推荐
27. Directory and file system
上课作业(6)——#575. 单词的划分(word)
AttributeError: module ‘seaborn‘ has no attribute ‘histplot‘
memcache缓存应用(LNMP+memcache)
C # exit login if there is no operation
Application modification log path log4j.properties
从哪些维度评判代码质量的好坏?如何具备写出高质量代码的能力?
MySQL学习笔记(总结)
被攻击怎么解决?DDoS高防IP防护策略
Varnish4.0缓存代理配置
Kubectl_ Easy to use command line tool: Oh my Zsh_ Tips and tricks
sklearn.metrics模块模型评价函数
什么是防火墙?防火墙能发挥什么样的作用?
云开发单机版图片九宫格流量主源码
Configuring WAPI certificate security policy for Huawei wireless devices
Is it safe for Huatai Securities to open an account? I don't know how to operate it
2022 robocom world robot developer competition - undergraduate group (provincial competition) -- question 3 running team robot (finished)
Is Huishang futures platform safe? Is it OK to open a futures account?
2022 robocom world robot developer competition - undergraduate group (provincial competition) rc-u4 strategy team (completed)
Database learning – select (multi table joint query) [easy to understand]