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. 虚拟机中CentoOs配置ip且连网

    1.修改"VMware Network Adapter VMnet8",配置IP 2.打开虚拟机,"编辑" => "虚拟网络编辑器", ...

  2. Redis的一些结构

  3. flask的session用法2

    from flask import Flask, session, redirect, url_for, escape, request app = Flask(__name__) @app.rout ...

  4. Flask系列(五)Flask实现分页

    一.flask分页组件 from urllib.parse import urlencode,quote,unquote class Pagination(object): ""& ...

  5. boost pool 和 object_pool

    内存池(Memory Pool)是一种内存分配方式.        通常我们习惯直接使用new.malloc等API申请分配内存,这样做的缺点在于:由于所申请内存块的大小不定,当频繁使用时会造成大量的 ...

  6. zookeeper集群-solrcloud集群

    本文只写具体的搭建过程,具体原理请看官网文档.国内博客都是基本上都是通过tomcat搭建的solr,本文是通过内部集成的jetty容器搭建. 一.zookeeper集群搭建 1.安装JAVA环境,版本 ...

  7. flask 上下文管理 &源码剖析

    基本流程概述 - 与django相比是两种不同的实现方式. - django/tornado是通过传参数形式实现 - 而flask是通过上下文管理, 两种都可以实现,只不实现的方式不一样罢了. - 上 ...

  8. android ReactNative之Cannot find entry file index.android.js in any of the roots

    android ReactNative之Cannot find entry file index.android.js in any of the roots 2018年04月02日 14:53:12 ...

  9. mysql索引之哈希索引

    哈希算法 哈希算法时间复杂度为O(1),且不只存在于索引中,每个数据库应用中都存在该数据结构. 哈希表 哈希表也为散列表,又直接寻址改进而来.在哈希的方式下,一个元素k处于h(k)中,即利用哈希函数h ...

  10. VS2010/MFC编程入门之十七(对话框:文件对话框)

    上一讲鸡啄米介绍的是消息对话框,本节讲解文件对话框.文件对话框也是很常用的一类对话框. 文件对话框的分类       文件对话框分为打开文件对话框和保存文件对话框,相信大家在Windows系统中经常见 ...