Im trying to reset a list's inheritance using javascript and Sharepoint 2010.
Here is my code so far:
<script language="JavaScript">
<!--
var vcms_currentCTX;
var vcms_currentWEB;
var vcms_lists;
var vcms_list;
var vcms_listID;
function sharePointReady()
{
vcms_listID = document.getElementById("listID").value;
vcms_currentCTX = SP.ClientContext.get_current();
vcms_currentWEB = vcms_currentCTX.get_web();
vcms_lists = vcms_currentWEB.get_lists();
vcms_list = vcms_lists.getById(vcms_listID);
vcms_list.resetRoleInheritance();
vcms_currentCTX.load(vcms_list);
vcms_currentCTX.executeQueryAsync(
Function.createDelegate(this, fcms_onRequestSucceeded2),
Function.createDelegate(this, fcms_onRequestFailed));
}
function fcms_onRequestSucceeded2() {
}
function fcms_onRequestFailed(sender,args){
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
I know I probably dont need to load and executeQueryAsync for this (using list.update() should be enough).
This code gives me the error
"The object doesnt support this property or method"
But I have seen the method being used in list objects somewhere else (i think it was on PowerShell).
Is ResetRoleInheritance not supported in javascript or my sharepoint version?