简体   繁体   中英

Sharepoint 2013 - Create group

I'm trying to create a Sharepoint 2013 (autohosted) group. In AppManifest I set Permissions> Site collection> Managed. Unfortunately I can not use Full-control.

var collGroups = ClientContextAppWeb.Web.SiteGroups;
ClientContextAppWeb.Load(collGroups);
ClientContextAppWeb.ExecuteQuery();

if (!collGroups.Any(a => a.Title.Equals("IT Helpdesk Admins")))
{
    var groupInfo = new Microsoft.SharePoint.Client.GroupCreationInformation()
    {
        Title = "IT Helpdesk Admins"
    };

    collGroups.Add(groupInfo);
    ClientContextAppWeb.Web.Update();
    ClientContextAppWeb.ExecuteQuery();
}

An error occurs when creating group - ServerUnauthorizedAccessException

Are there other options to create groups?

It can read value at the top level but when if try to query for webs.Webs, web.Lists or web.RootFolder, this is when you get the exception. With a full user account it dont have the problem, but for others users will only have limited access to certain areas of the site, ie a particular document library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM