创建一个dynamics 365 CRM online plugin (七) - plugin当中的Impersonation角色
我们之前创建的plugin都是使用default的 run in User's Context.
理解就是使用正在登陆的security context用户信息

那有个问题,如果当前用户的security role没有相应的权限访问功能,我们就要安排一个新的用户 e.g. admin来记录信息而非当前用户.

让我们在registration tool更新TaskCreate class之后再CRM中打开新建Contacts.
我们可以打开activities发现follow up 里用户更改为在plugin registration tool中更改的用户.

第二种方法,我们可以做impersonation 的地方是plugin 的代码当中
首先我们把run in user's context 改为Calling User

首先我们要先知道admin的GUID,知道GUID之后我们才可以创建一个新的OrganizationService.
// This is for the impersonation
IOrganizationService adminService = serviceFactory.CreateOrganizationService(new Guid());
其次, 我们用创建好的adminService在try中做创建task.
// Inpersonation in Plugins
adminService.Create(taskRecord);

创建一个dynamics 365 CRM online plugin (七) - plugin当中的Impersonation角色的更多相关文章
- 创建一个dynamics 365 CRM online plugin (九) - Context.Depth
让我们来看看官方文档是怎么讲的 https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide ...
- 创建一个dynamics 365 CRM online plugin (四) - PreValidation
开始之前,我们要确认一下 Plugin 的 pipeline. PreValidation -> PreOperation -> Server Side System Main Event ...
- 创建一个dynamics 365 CRM online plugin (三) - PostOperation
上两节我们创建了一个 PreOperation的plugin 今天我们创建一个PostOpeartion的plugin和之前的plugin连接起来 当创建contact之后,我们要添加一个task给新 ...
- 创建一个dynamics 365 CRM online plugin (一) - Hello World Plugin
源代码连接:https://github.com/TheMiao/Dynamics365CRM/blob/master/MyCRM/MyCRM/HelloWorld.cs 首先,我们需要创建一个.NE ...
- 创建一个dynamics 365 CRM online plugin (十) - Isolation mode or trust mode
Isolation Mode 也被称作为Plugin Trust CRM里面有两种plugin trust / isolation mode 1. Full Trust 只在OP系统中可使用,没有限制 ...
- 创建一个dynamics 365 CRM online plugin (五) - Images in Plugin
Snapshots of the primary entity's attributes from database before(pre) and after (post) the core pla ...
- 创建一个dynamics 365 CRM online plugin (八) - 使用Shared Variables 在plugins 之前传递data
CRM 可以实现plugin之前的值传递. 我们可以使用SharedVariables 把值在plugin之间传递 实现plugins之间的传递非常简单,我们只需要用key value pair来配对 ...
- 创建一个dynamics 365 CRM online plugin (六) - Delete plugin from CRM
我们之前都学习到怎么添加,debug还有update plugin. 今天带大家过一下怎么从CRM instance当中删除plugin. 首先让我们打开Settings -> Customiz ...
- 创建一个dynamics 365 CRM online plugin (二) - fields检查
Golden Rules 1. Platform only passes Entity attributes to Plugin that has change of data. 2. If the ...
随机推荐
- rabbitmq web 管理系统的信息
rabbitmq web 管理系统的信息 端口 15672 帐号密码 guest/guest 要开启web 管理, 需要手动执行命令: rabbitmq-plugins enable rabbit ...
- Js的运算符
JS的运算符 1.运算符的分类: a) 算数运算符 b) 字符串运算符 c) 赋值运算符 d) 比较运算符 e) 逻辑运算符 f) 位运算符 g) 其他运算符 2.算数运算符 + 加法运算符 - 减法 ...
- 最近在研究syslog日志,就说一下syslog格式吧
syslog格式:<PRI>HEADER MESSAGE syslog的消息长度:不超过1024.syslog格式举例:<15>Jul 10 12:00:00 192.168. ...
- Some notes in Stanford CS106A(1)
Karel world 1.During make a divider operation --int x=5; double y = x/2 => y=2 we need sth as a ...
- EL(Expression Language)表达式语言
EL(Expression Language)表达式语言 EL的基本语法是以${开始,以}结束 为了能够方便地输出数据,EL提供了11个内置对象,其中 2个内置对象为了方便输出请求参数 param用来 ...
- 前端开发:一个开源、简单易用的jQuery表格插件(DataTables)
DataTables是一个基于jQuery库的开源(MIT协议)表格插件,支持添加.排序.分页.搜索.过滤等功能,使用简单.广受欢迎,能够与主流前端UI整合(如bootstrap.jQuery UI等 ...
- Android Studio 入口程序的设置方法
在src -> main中 ,打开 AndroidManifest.xml 这个文件 下面这里有两个窗口,如果要想把哪个窗口设置成入口窗体,只要把下面红色的放在这个节点中就可以了 <act ...
- Guangcong Wang王广聪的主页
请点击Guangcong Wang王广聪的主页更多信息.
- 如何在Linux上设置SSH密码以进行无密码登录(转)
ssh(secure shell)广泛用于远程登录Linux服务器.当我们使用ssh登录到远程系统时,它会提示输入密码,然后只允许我们登录到服务器.有时我们需要配置应用程序或脚本(主要是shell脚本 ...
- python-markdown
python-markdown无法将“`生成标签问题解决方法 2种都是代码区块 ```swift is Int ``` is Int