خرید بک لینک

Vote count: 0

I am trying to get a particular folder using JSOM, in order to set group permissions. There is group called NewGroup which should assigned to a folder called NewFolder in the Document Library called 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));

I am unable to get the result using this code. Please correct me where I am wrong.

asked 56 secs ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 24 تير 1395 ساعت: 18:28

صفحه بندی