Script to Stop List Permissions Inheritance via API

setStopListPermissionsInheritance: function(item, beforeComplete) {
var ctx = new SP.ClientContext.get_current();
var web = ctx.get_web();
var curUser = web.get_currentUser(); 
var list = ctx.get_web().get_lists().getByTitle(listName);
var lstItem = list.getItemById(;
lstItem.breakRoleInheritance(true, false);

ctx.executeQueryAsync(onStopInheritPermissionsComplete, this.onSPExecFail);

function onStopInheritPermissionsComplete (sender, args) {
var options = SP.UI.$create_DialogOptions();
options.title = "Grant Permissions";
options.url = String.format("/_layouts/aclinv.aspx?obj={0},{1},FOLDER&List={0}&IsDlg=1",list.get_id(),;

Tagged with: ,
Posted in 2010, JavaScript, Microsoft SharePoint Server

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Antek Group Blog
%d bloggers like this: