I am trying to determine how to use permissions for a project I am working on and I think I will have to use custom permissions for documents sets. I have read that too many custom permissions can cause performance issues though. If I could add a java script that caused the document set to re-inherit permissions once the status was marked as complete I think that would help keep the number of custom permissions down without requiring an administrator to go in and manually change each one. Is this possible?
Edit
Now I understand how to use the java script to restore permissions inheritance but I am still having trouble with understanding how to trigger this based on a status value I tried the code below but realized I need to use JSOM to get the value of the status category. I know how to get list data with JSOM but all the examples I have seen show outputting this data into a div. This scenario is a bit different and I'm not quite sure what to change.
function ResumeInheritance() {
if(status === "Closed") {
JSRequest.EnsureSetup();
var idValue = JSRequest.QueryString["ID"];
var clientCtx = SP.ClientContext.get_current();
var list = clientCtx.get_web().get_lists().getByTitle('Tasks');
var item = list.getItemById(idValue);
item.resetRoleInheritance();
clientCtx.executeQueryAsync(function(){alert('success')},function(s,a){alert(a.get_message())});}
}
ResumeInheritance();