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 ...
随机推荐
- asymmetric cryptographic algorithm
https://baike.baidu.com/item/非对称加密算法/1208652?fr=aladdin 主要算法 编辑 RSA.Elgamal.背包算法.Rabin.D-H.ECC(椭圆曲线加 ...
- python装饰器的应用案例
目录 一.过程编程 二.面向装饰器和函数的编程 三.二的加强版 一.过程编程 (一)需求:打印菱形 1.空格.*号组成的菱形 2.输入菱形上半部分的行数即可打印 3.支持循环输入 (二)代码 from ...
- R语言基本语法
R语言基本语法 基本数据类型 数据类型 向量 vector 矩阵 matrix 数组 array 数据框 data frame 因子 factor 列表 list 向量 单个数值(标量)没有单独的数据 ...
- 如何使用OpenCart 2.x Event事件系统
如何使用OpenCart 2.x Event事件系统 OpenCart 2.x 包含很多新特性,其中之一就是专为开发者提供的事件系统,Event System.它允许你在不修改原有系统代码的基础上( ...
- IBM WebSphere MQ for net 报错 MQRC_NOT_AUTHORIZED
最近进入新公司要维护以前的90年代的老系统 用NET对IBMMQ做测试 NET 4.0 +7.5 MQ 版本 待我写好NET调用的代码后出现错误MQRC_NOT_AUTHORIZED 折腾大半天往上找 ...
- SQL Server与Oracle对表添加列的不同点
逛了博客园两年有余,不知道该发表些什么.要么觉得自己太菜,要么觉得要发的内容都可以搜索到,发表了还颇有抄袭味道.想想后都不得了之了. 搞了开发快一年了,有时候零零碎碎的东西需要整理一下,梳理后才能做到 ...
- hdu1700 Points on Cycle
地址:http://acm.split.hdu.edu.cn/showproblem.php?pid=1700 题目: Points on Cycle Time Limit: 1000/1000 MS ...
- bzoj1621 / P2907 [USACO08OPEN]农场周围的道路Roads Around The Farm
P2907 [USACO08OPEN]农场周围的道路Roads Around The Farm 基础dfs,按题意递归即可. #include<iostream> #include< ...
- linux内核分析第五周-分析system_call中断处理过程
本实验目的:通过以一个简单的menu小程序,跟踪系统调用的过程,分析与总结系统调用的机制和三层进入的过程. 实验原理:系统调用处理过程与中断处理的机制 系统调用是通过软中断指令 INT 0x80 实现 ...
- 20145201李子璇 《网络对抗》 Web安全基础实践
1.实验后回答问题 (1)SQL注入攻击原理,如何防御 原理:通过构建特殊的输入作为参数传入web应用程序.即把SQL命令注入到Web表单的输入域或页面请求的查询字符串,和之前已经设定好的查询语句构成 ...