使用SharePoint Designer(SPD)工作流将组的权限分配给列表 [英] Assign Permissions for a Group to a List using SharePoint Designer (SPD) Workflow

查看:144
本文介绍了使用SharePoint Designer(SPD)工作流将组的权限分配给列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有现有的查询列表,"单位","类别"和"货币"。 

无论出于何种原因,这些群组都无法继承网站的权限,当我创建新组时,我必须手动将新组分配给所有三个查找列表。 (事实是我有15个查找,但我们假装我只有3个。)


我想创建一个组,然后运行一个执行赋值的SPD工作流为我工作。每个组都需要对查找列表的读取权限。


我找到了以下用于执行赋值的REST API javascript代码: 


https ://technet.microsoft.com/en-us/windows/dn495392(v = office.14)


我认为我可以使用SPD 2013 WF "呼叫... HTTP Web服务"根据此特定函数执行向新组的列表授予读取权限的操作:

 

<代码ID = "x_x_c_87368cc0fd9d49448821dc8efa22d45c">的 // 新增&NBSP;的&NBSP;新&NBSP;作用&NBSP;分配&NBSP;为&NBSP;的&NBSP;组&NBSP;在&NBSP;的&NBSP;列表&NBSP;
<跨度类= "x_x_js__operator" 样式= "颜色:红深蓝;字型重量:粗体">功能&NBSP; setNewPermissionsForGroup()&NBSP; <跨度类="x_x_js__brace "style ="color:red; font-weight:bold"> {
 
     VAR &NBSP; endpointUri&NBSP; =&NBSP; appweburl&NBSP; +&NBSP; <跨度类=" x_x_js__string"样式= "颜色:蓝绿色">" / _ AP​​I / SP.AppContextSite(@target)/幅/列表/ getbytitle('" ;&NBSP;
&NBSP;&NBSP;&NBSP;&NBSP; endpointUri&NBSP; + =&NBSP; LISTTITLE&NBSP; +&NBSP; <跨度类="x_x_js_ _string"样式= "颜色:蓝绿色">"')/ roleassignments / addroleassignment(principalid = QUOT; &NBSP; +&NBSP;的groupId;&NBSP;
&NBSP;&NBSP;&NBSP;&NBSP; endpointUri&NBSP; + =&NBSP; <跨度类= "x_x_js__string" 样式= "颜色:蓝绿色">",roledefid = QUOT; &NBSP; +&NBSP; targetRoleDefinitionId&NBSP; +&NBSP; <跨度类= "x_x_js__string" 风格="颜色:蓝绿色">")@目标= '" &NBSP; +&NBSP; hostweburl&NBSP; +&NBSP; <跨度类= x_x_js__string "样式= "颜色:蓝绿色">"?";' "

 
     executor.executeAsync( {&NBSP;
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; URL:&NBSP; endpointUri,&NBSP;
&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;方法:&NBSP; <跨度类= "x_x_js__string" 样式= "颜色:蓝绿色"> 'POST',&NBSP;
&NBSP;&NBSP;&NBSP ;      headers:  {&NBSP; <跨度类=" x_x_js__string"样式= "颜色:蓝绿色"> 'X-RequestDigest':$(<跨度类= "x_x_js__string" 风格= "color:teal">"#__ REQUESTDIGEST")。val()  } ,&NBSP;
&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;成功:&NBSP; successHandler,&NBSP;
&NBSP;&NBSP ;       error:  errorHandler 
     } ); 
} &NBSP;

<代码ID =" x_x_c_87368cc0fd9d49448821dc8efa22d45c">第一个问题是,将这种工作?
第二个是,使用上面的列表名称,读取权限,使用适当的RequestHeaders和url来实现这一点,并假设组号是751.

<代码ID = "x_x_c_87368cc0fd9d49448821dc8efa22d45c">感谢

史蒂夫克拉克
简易垃圾箱垃圾箱出租
的https://! www.easy-bins.com


解决方案

您好,


以下是供您参考的主题。


http:// www .benprins.net / 2017/01/03 / sharepoint-2013-workflow-changing-permissions-with-rest-calls /


请求标题:



最好的问候,



I have existing lookup lists, "Units", "Category", and "Currency". 
For whatever reason, these group cannot inherit permissions from the Site, and when I create new groups, I have to manually assign the new group to all three of the lookup list. (Truth is that I have 15 lookups, but we'll pretend I only have 3 for this.)

I would like to create a group, then run an SPD Workflow that does the assignment work for me. Each group needs read rights to the lookup lists.

I found the following REST API javascript code for performing assignments: 

https://technet.microsoft.com/en-us/windows/dn495392(v=office.14)

I assume that I can use an SPD 2013 WF with the "Call ... HTTP Web Service" action to execute the granting of the Read Permission to the list for the new group, based upon this specific function:

// Add the new role assignment for the group on the list. 
function setNewPermissionsForGroup() { 
    var endpointUri = appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('"
    endpointUri += listTitle + "')/roleassignments/addroleassignment(principalid=" + groupId; 
    endpointUri += ",roledefid=" + targetRoleDefinitionId + ")?@target='" + hostweburl + "'"
 
    executor.executeAsync({ 
        url: endpointUri, 
        method: 'POST'
        headers: { 'X-RequestDigest':$('#__REQUESTDIGEST').val() }
        success: successHandler, 
        error: errorHandler 
    }); 
} 

The first question is, WILL THIS WORK?
The second is, what is the proper RequestHeaders and url to make this happen, using the list names above, Read Permissions, and let's assume the group number is 751.

Thanks!

Steve Clark
Easy Bins Dumpster Rentals
https://www.easy-bins.com


解决方案

Hi,

Here is the thread for your reference.

http://www.benprins.net/2017/01/03/sharepoint-2013-workflow-changing-permissions-with-rest-calls/

Request header:

Best Regards,

Lee


这篇关于使用SharePoint Designer(SPD)工作流将组的权限分配给列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆