Granting and Managing Item Level Permission using SharePoint2013 Designer Workflow
https://gnanasivamgunasekaran.wordpress.com/2015/12/29/granting-and-managing-item-level-permission-using-sharepoint2013-designer-workflow/
Granting permission to the user by SharePoint 2013 designer workflow is different from SharePoint 2010.we are using the Rest API to grant the permission as follows
Create the Workflow and assign permission
- Open the site in SharePoint 2013 designer and select the list for which workflows needs to be created and click new option,

- Specify the name of the workflow and click ok ,

- Add the action build the dictionary ,

- After adding the actions create the headers for REST api call as follows,

- Click the link this and create the following two variables
| Name | Type | Value |
| Accept | String | application/json;odata=verbose |
| Content-Type | String | application/json;odata=verbose |
- Create the following local variables by clicking the local variables link in top ribbon,

| Name | Type |
| responseContent | Dictionary |
| responseHeaders | Dictionary |
| responseCode | String |
| requestHeaders | Dictionary |
- Now set the requestHeaders variable to the outcome variable of dictionary builded.
- Then add the Call Http web service action,

- Right click the above action and configure the properties as follows,

- Add the following URL in above action and select the HTTP method as POST as follows,
“{SiteURL}/_api/web/lists/getbytitle(‘Sample’)/items(1)/breakroleinheritance(true)”

- The above http call will stop inheritance of permission for the item with id 1.
- After that add one more Call http web service action, configure the same properties as same as previous action.
- Now configure the following URL in Enter Http web service URL and specify the method as HTTP Post,
“{SiteURL}/_api/web/lists/getbytitle(‘Sample’)/items(1)/roleassignments/addroleassignment(principalid=12,roleDefId=1073741926)”
- In this Principal ID is the Id of the User to whom we need to grant permission and roledefinition Id is the permission level Id which can identified using the following URL
“{SiteURL}/_api/web/roledefinitions”

- That’s it , while running this workflow the REST api call will break the inheritance role for the particular item and grant the specified permission level (RolDefId) for the user .
Removing the Permission of Specified user
- For removing the permission of the user in particular item, we need to design workflow as same as above for granting permissions.
- Similarly same HTTP action to be called to break the role inheritance and call one HTTP action with the below URL,
{SiteURL}/_api/web/lists/getbytitle(‘Sample’)/items(1)/roleassignments/getbyprincipalid(12)
Get by principal ID is the ID of the User.
- Then select the HTTP method as delete

- Now running the above workflow it will fill stop inheriting the permission and the second web service call will remove the permission for the user with ID 12.
Granting and Managing Item Level Permission using SharePoint2013 Designer Workflow的更多相关文章
- SharePoint2013工作流workflow manager配置
SharePoint2013版本的工作流较sharepoint 2010变化较大,将工作流部分从sharepoint中分离出来为单独的服务,通过与sharepoint关联使用. SharePoint2 ...
- SharePoint Security and Permission System Overview
转:http://www.sharepointblues.com/2010/09/01/sharepoint-security-and-permission-system-overview/ Shar ...
- Binary Tree Level Order Traversal II [LeetCode]
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left ...
- Binary Tree Level Order Traversal [LeetCode]
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...
- 4.4. Item Pipeline管道文件
0:Spider爬取数据 # -*- coding: utf-8 -*- import scrapy import sys from mySpider.items import ItcastItem ...
- Sharepoint学习笔记—习题系列--70-576习题解析 -(Q25-Q28)
Question 25 You are designing a SharePoint 2010 farm in your organization. You need to design the li ...
- Oracle Applications Multiple Organizations Access Control for Custom Code
档 ID 420787.1 White Paper Oracle Applications Multiple Organizations Access Control for Custom Code ...
- SharePoint Server 2019新特性
.基于.NET4.7框架 功能基本是把office365的SPO功能搬家过来.如下: Sharepoint server 2019将在2018年发布 New web parts There were ...
- Microsoft SQL Server Trace Flags
Complete list of Microsoft SQL Server trace flags (585 trace flags) REMEMBER: Be extremely careful w ...
随机推荐
- 利用maven-assembly-plugin加载不同环境所需的配置文件及使用场景
背景: 如何加载不同环境的配置文件已经成了势在必行的,我们通常利用profile进行,详情参见我上篇博客 http://www.cnblogs.com/lianshan/p/7347890.html, ...
- 容斥原理解决某个区间[1,n]闭区间与m互质数数量问题
首先贴出代码(闭区间[1,n]范围内和m互质的数) 代码: int solve(II n,II m){ vector<II>p; ;i*i<=m;i++){ ){ p.push_ba ...
- Educational Codeforces Round 28
A. Curriculum Vitae 题目链接:http://codeforces.com/contest/846/problem/A 题目意思:给你一个只包含0-1的数组,现在要求去可以去掉一些元 ...
- ES6基础教程(整理自阮一峰)
------------------------ECMAScript 6 简介------------------------ECMAScript 和 JavaScript 的关系是,前者是后者的规格 ...
- php5.6 的curl开启和之前的不太一样了,搞了半天,记录下
设置电脑环境变量中的->系统变量(注:不是用户变量) 新建 PHP_HOME 值 D:\php /PHP 根目录 Path 增加 ;%PHP_HOME%;%PHP_HOME%\ext ...
- VirtualBox Guest Additions installation
在使用VirtualBox为CentOS安装增强功能时,输出是: 文本: Verifying archive integrity... All good. Uncompressing VirtualB ...
- nodejs学习笔记Node.js 调试命令
3.4 调试 47 下面是一个简单的例子: $ node debug debug.js < debugger listening on port 5858 connecting ...
- MySQL和MSSQL差异(增量)备份的原理
MySQL和MSSQL差异(增量)备份的原理 对于真正的增量备份来说,只需要记录当前每页最后的检查点的LSN,如果大于之前全备时的LSN,则备份该页面,否则不用备份 这大大加快了备份速度和恢复时间,同 ...
- array2xml xml2array
array2xml/** * * 将简单数组转化为简单的xml * @param string $data 要进行转化的数组 * @param string $tag ...
- vue小toast插件报错runtine-only
var Toast={}; Toast.install = function (Vue, options) { let opt = { defaultType:'bottom', // 默认显示位置 ...