Quantcast
Channel: SharePoint 2013 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 21070

Assign Permissions for a Group to a List using SharePoint Designer (SPD) Workflow

$
0
0

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



Viewing all articles
Browse latest Browse all 21070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>