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);
ctx.load(list);
var lstItem = list.getItemById(item.id);
lstItem.breakRoleInheritance(true, false);
lstItem.update();
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(), item.id);
SP.UI.ModalDialog.showModalDialog(options);
}
}
Like this:
Like Loading...
Related
Leave a Reply