Tutorial :Re-inheriting permissions from parent SharePoint list



Question:

So I know how to break inheritance from a list (SPList.BreakRoleInheritance(true)), but how do you reinherit from it's parent programmatically?

Thanks


Solution:1

The MSDN link.

SPList.ResetRoleInheritance();


Solution:2

As an end point URL here is an example of how to do it via JQuery Ajax function -

            $.ajax({              url: "*Site URL here*/_api/web/lists/getByTitle('*your list name here*')/items(*item ID here*)/ResetRoleInheritance()",              type: "POST",              headers: {                  "Accept": "application/json;odata=verbose",                  "X-RequestDigest": $("#__REQUESTDIGEST").val(),              },              success: function (data) {                  console.log('Permissions successful applied to list item!');              },              error: function (data) {                  console.log('Failed!');              }          });  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »