我正在尝试使用JSOM获取特定文件夹,以便设置组权限。有一个名为NewGroup的组,它应分配给文档库中名为NewFolder的文件夹,名为Shared Documents。
var clientContext = new SP.ClientContext.get_current();
var oWebsite = clientContext.get_web();
var collGroup = oWebsite.get_siteGroups();
var oGroup = collGroup.getByName("NewGroup");
var role = SP.RoleDefinitionBindingCollection.newObject(clientContext);
role.add(oWebsite.get_roleDefinitions().getByType(SP.RoleType.contributor));
var oFolder = oWebsite.getFolderByServerRelativeUrl("/ActivityTracker/Shared%20Documents/NewFolder");
oFolder.breakRoleInheritance(false, true);
oFolder.get_roleAssignments().add(oGroup, role)
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
我无法使用此代码获得结果。请纠正我错在哪里。