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. 导出无法正常启动的VMware虚拟机中的文件

    为了使用网银,在MacBook中用VMware虚拟机跑Windows 8.今天在使用Windows 8时,Windows Update自动安装了更新并自动重启,结果怎么也启动不起来了.不是停在&quo ...

  2. Spring 体系结构

    https://www.w3cschool.cn/wkspring/dcu91icn.html 体系结构 Spring 有可能成为所有企业应用程序的一站式服务点,然而,Spring 是模块化的,允许你 ...

  3. 用 chown 和 chmod 修改目录所属用户及权限

    1.修改 tmp 目录所属用户为 root,用户组为 root chown -R root:root /tmp12.修改 tmp 目录为可写权限 chmod -R 777 /tmp

  4. 详解maxlength属性在textarea里奇怪的表现

    这篇文章主要介绍了maxlength属性在textarea里奇怪的表现的相关资料,需要的朋友可以参考下 HTML5给表单带来了很多改变,比如今天要说的maxlength,这个属性可以限制输入框输入的最 ...

  5. 【python】Python3 循环语句

    [python]几种常见的循环 注意:如果涉及到程序中print语句中含有%d,%s,那么要在脚本最开始写语句:#coding=utf-8,才能够正常输出想要的数字或者字符串. Python3 循环语 ...

  6. jquery 重复导入问题

    $(...).bootstrapTable is not a function

  7. Spring boot 集成ckeditor

    1:下载ckeditor  4.4.2 full package ,官网没有显示, 需要在最新版本的ckeditor download右键,复制链接, 输入到导航栏,将版本号改为自己想要的版本号. h ...

  8. PHP指定概率算法

    转载来源链接: https://blog.csdn.net/sinat_35861727/article/details/54980807 PHP指定概率算法,可用于刮刮卡,大转盘等抽奖算法. 假设: ...

  9. spark2.1.1创建Pipeline

    Pipeline 为流程,是Spark创建机器学习的一个流程控制的类 下面直接贴出创建的代码,以及整个流程 第一种: import org.apache.spark.ml.{Pipeline, Pip ...

  10. Spring整合Mybatis解决 Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    在Spring4和Mybatis3整合的时候,dao层注入'sqlSessionFactory'或'sqlSessionTemplate'会报错解决办法如下: package com.alibaba. ...