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的更多相关文章

  1. SharePoint2013工作流workflow manager配置

    SharePoint2013版本的工作流较sharepoint 2010变化较大,将工作流部分从sharepoint中分离出来为单独的服务,通过与sharepoint关联使用. SharePoint2 ...

  2. SharePoint Security and Permission System Overview

    转:http://www.sharepointblues.com/2010/09/01/sharepoint-security-and-permission-system-overview/ Shar ...

  3. 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 ...

  4. Binary Tree Level Order Traversal [LeetCode]

    Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, ...

  5. 4.4. Item Pipeline管道文件

    0:Spider爬取数据 # -*- coding: utf-8 -*- import scrapy import sys from mySpider.items import ItcastItem ...

  6. Sharepoint学习笔记—习题系列--70-576习题解析 -(Q25-Q28)

    Question 25 You are designing a SharePoint 2010 farm in your organization. You need to design the li ...

  7. Oracle Applications Multiple Organizations Access Control for Custom Code

    档 ID 420787.1 White Paper Oracle Applications Multiple Organizations Access Control for Custom Code ...

  8. SharePoint Server 2019新特性

    .基于.NET4.7框架 功能基本是把office365的SPO功能搬家过来.如下: Sharepoint server 2019将在2018年发布 New web parts There were ...

  9. Microsoft SQL Server Trace Flags

    Complete list of Microsoft SQL Server trace flags (585 trace flags) REMEMBER: Be extremely careful w ...

随机推荐

  1. 广通软件获“2016年度中国最具影响力IT运维管理软件提供商”殊荣

    12月16日,“科技原力觉醒引领创新巅峰”-- 2016创新影响力年会暨国家产业服务平台•2016年终评活动在北京裕龙国际酒店落下帷幕. 本活动在主管部门的指导参与下,总结本年度技术成果并籍此对未来科 ...

  2. 安装Ruby、Sass在WebStrom添加Watcher实现编辑scss文件时自动生成.map和压缩后的.css文件

    前言 这段时间一直在看Bootstrap,V3官方直接提供了Less版本的源码,就先将Less学完了,很简单的语法,学习写Demo都是在Webstorm里写的,配置了Watcher自动编译(详见< ...

  3. 【Python】Python 打印和输出更多用法。

    Python 打印和输出 简述 在编程实践中,print 的使用频率非常高,特别是程序运行到某个时刻,要检测产生的结果时,必须用 print 来打印输出. 关于 print 函数,前面很多地方已经提及 ...

  4. Laravel 5.* 中路由绑定 Controller 包含子目录写法

    https://blog.csdn.net/maxsky/article/details/54017981 [可以使用命令在项目根目录一键创建 php artisan make:controller ...

  5. 运行HBase应用开发程序产生异常,提示信息包含org.apache.hadoop.hbase.ipc.controller.ServerRpcControllerFactory的解决办法

    Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties Exception in thread ...

  6. [py][mx]django实现课程机构排名

    如果是第一次做这个玩意,说实话,确实不知道怎么弄, 做一次后就有感觉了 此前我们已经完成了: 分类筛选 分页 这次我们做的是 课程机构排名 知识点: - 按照点击数从大到小排名, 取出前三名 hot_ ...

  7. 用ildasm/ilasm修改IL代码(操作步骤)

    在开发中遇到这样一个场景,需要修改一个dll文件(.NET程序集)中某些地方的类型名称,但没有源代码,只能修改IL代码. 操作步骤如下: 1. 运行ildasm ildasm是由微软提供的.NET程序 ...

  8. 2.1 The Object Model -- Classes and Instances(类和实例)

    一.Defining Classes(定义类) 1. 定义一个新的Ember类,调用Ember.Object上的extend()方法: example:定义了一个含有say()方法的新的Person类 ...

  9. php根据路径获取文件名

    <?php // 根据路径返回文件名 $path = 'J:\abc\defg\hijk\一个文件夹\lmn\opq'; $path = iconv("UTF-8", &qu ...

  10. 一次org.springframework.jdbc.BadSqlGrammarException ### Error querying database Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException问题排查过程

    先说结论: 因为在表设计中有一个商品描述字段被设置为desc,但desc是mysql中的关键字,如select id,name,desc,price from product;这条sql语句在查询时的 ...