【问题标题】:Breaking the security inheritance of a site (SharePoint, C#)破坏站点的安全继承(SharePoint、C#)
【发布时间】:2012-02-14 10:21:50
【问题描述】:

以下代码 sn-p 破坏了列表的安全继承。

        string siteUrl = "http://MyServer/sites/MySiteCollection";
        ClientContext oContext = new ClientContext(siteUrl);
        SP.List oList = oContext.Web.Lists.GetByTitle("Announcements");

        oList.BreakRoleInheritance(true, false);

        oContext.ExecuteQuery();

如何为网站做同样的事情?参考:http://msdn.microsoft.com/en-us/library/ee535228.aspx

【问题讨论】:

    标签: c# sharepoint sharepoint-2010


    【解决方案1】:

    基本上你可以使用:

    SPWeb web = SPContext.Current.Web;
    web.BreakRoleInheritance(true, false);
    

    参考:SPWeb.BreakRoleInheritance Method

    【讨论】:

      猜你喜欢
      • 2012-02-25
      • 1970-01-01
      • 1970-01-01
      • 2016-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-08
      • 1970-01-01
      相关资源
      最近更新 更多