当前位置: 首页>>代码示例>>C#>>正文


C# Tenant.AddAdministrators方法代码示例

本文整理汇总了C#中Tenant.AddAdministrators方法的典型用法代码示例。如果您正苦于以下问题:C# Tenant.AddAdministrators方法的具体用法?C# Tenant.AddAdministrators怎么用?C# Tenant.AddAdministrators使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tenant的用法示例。


在下文中一共展示了Tenant.AddAdministrators方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddAdministratorsTenant

        public static void AddAdministratorsTenant(this Web web, IEnumerable<UserEntity> adminLogins, Uri siteUrl, bool addToOwnersGroup = false)
        {
            Tenant tenant = new Tenant(web.Context);

            tenant.AddAdministrators(adminLogins, siteUrl, addToOwnersGroup);

        }
开发者ID:AaronSaikovski,项目名称:PnP,代码行数:7,代码来源:SecurityExtensions.deprecated.cs

示例2: AddAdministratorsTenant

        public static void AddAdministratorsTenant(this Web web, String[] adminLogins, Uri siteUrl)
        {
            Tenant tenant = new Tenant(web.Context);

            tenant.AddAdministrators(adminLogins, siteUrl);
        }
开发者ID:ADefWebserver,项目名称:PnP,代码行数:6,代码来源:SecurityExtensions.cs

示例3: Execute


//.........这里部分代码省略.........
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:core,SiteNotebookLink", new Uri(string.Format("{0}/_layouts/15/WopiFrame.aspx?sourcedoc={1}&action=editnew", this.SharePointProvisioningData.Url, notebookPath)), "", NavigationType.QuickLaunch);
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:core,taskList", new Uri(string.Format("{0}/Lists/Tasks/AllItems.aspx", this.SharePointProvisioningData.Url)), "", NavigationType.QuickLaunch);
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:core,calendarList", new Uri(string.Format("{0}/Lists/Calendar/calendar.aspx", this.SharePointProvisioningData.Url)), "", NavigationType.QuickLaunch);
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:core,shareddocuments_Title_15", new Uri(string.Format("{0}/Shared Documents/Forms/AllItems.aspx", this.SharePointProvisioningData.Url)), "", NavigationType.QuickLaunch);
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:core,linksList", new Uri(string.Format("{0}/Lists/Links/Tiles.aspx", this.SharePointProvisioningData.Url)), "", NavigationType.QuickLaunch);
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:core,GrpMedia", new Uri(string.Format("{0}/Media/Forms/Thumbnails.aspx", this.SharePointProvisioningData.Url)), "", NavigationType.QuickLaunch);
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:spscore,Members_QuickLaunch", new Uri(string.Format("{0}/{1}", this.SharePointProvisioningData.Url, siteMembersUrl)), "", NavigationType.QuickLaunch);
                this.CreatedSiteContext.Web.AddNavigationNode("$Resources:core,category_SiteContents", new Uri(string.Format("{0}/_layouts/15/viewlsts.aspx", this.SharePointProvisioningData.Url)), "", NavigationType.QuickLaunch);

                // Insert demo promoted links list item
                if (contosoCollaborationPromotedSiteName.Length > 0 || contosoCollaborationPromotedSiteUrl.Length > 0)
                {
                    AddPromotedSiteLink(this.CreatedSiteContext, this.CreatedSiteContext.Web, "Links", contosoCollaborationPromotedSiteName, contosoCollaborationPromotedSiteUrl);
                }

                if (!this.CreateOnPremises)
                {
                    // add owners to site collection administrators
                    List<UserEntity> adminLogins = new List<UserEntity>();

                    int i = 0;
                    foreach (SharePointUser owner in this.SharePointProvisioningData.Owners)
                    {
                        adminLogins.Add(new UserEntity()
                            {
                                 Email = owner.Email,
                                 LoginName = owner.Login,
                                 Title = owner.Name,
                            });
                        i++;
                    }

                    Tenant tenant = new Tenant(this.AppOnlyClientContext);
                    tenant.AddAdministrators(adminLogins, new Uri(this.SharePointProvisioningData.Url), true);

                    // Everyone reader
                    this.CreatedSiteContext.Web.AddReaderAccess();
                }

                // Apply themes
                string themeRoot = Path.Combine(this.AppRootPath, String.Format(@"Themes\{0}", contosoCollaborationThemeName));
                string spColorFile = Path.Combine(themeRoot, string.Format("{0}.spcolor", contosoCollaborationThemeName));
                string spFontFile = Path.Combine(themeRoot, string.Format("{0}.spfont", contosoCollaborationThemeName));
                string backgroundFile = Path.Combine(themeRoot, string.Format("{0}bg.jpg", contosoCollaborationThemeName));
                string logoFile = Path.Combine(themeRoot, string.Format("{0}logo.png", contosoCollaborationThemeName));

                // Deploy theme files to root web, if they are not there and set it as active theme for the site
                string themeColorFileString = "";
                string themeFontFileString = "";
                string themeBackgroundImageString = "";

                if (!String.IsNullOrEmpty(themeRoot))
                {
                    themeColorFileString = this.CreatedSiteContext.Web.UploadThemeFile(themeRoot).ServerRelativeUrl;

                }
                if (!String.IsNullOrEmpty(spColorFile))
                {
                    themeFontFileString = this.CreatedSiteContext.Web.UploadThemeFile(spColorFile).ServerRelativeUrl;
                }

                if (!String.IsNullOrWhiteSpace(backgroundFile))
                {
                    themeBackgroundImageString = this.CreatedSiteContext.Web.UploadThemeFile(backgroundFile).ServerRelativeUrl;
                }
开发者ID:Calisto1980,项目名称:PnP,代码行数:66,代码来源:ContosoCollaboration.cs


注:本文中的Tenant.AddAdministrators方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。