zoukankan      html  css  js  c++  java
  • SPSecurity.RunWithElevatedPrivileges 拒绝访问

    SPSecurity.RunWithElevatedPrivileges 可以提升权限 实现模拟管理员身份的功能 ,但是SPContext.Current.Site,

    SPContext.Current.Web 根据这些方法获得的对象都是以当前登录用户权限运作。

    SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite spSiteNew = new SPSite(SPContext.Current.Site.ID))
                {
                    using (SPWeb spWebNew = spSiteNew.OpenWeb(SPContext.Current.Web.ID))
                    {

            //自己的方法                    

                    }
                }
            });

  • 相关阅读:
    LeetCode 169
    LeetCode 152
    LeetCode 238
    LeetCode 42
    LeetCode 11
    GDB基本调试
    小咪买东西(最大化平均值)
    codeforces 903D
    hdu 5883
    hdu 5874
  • 原文地址:https://www.cnblogs.com/cangqiong/p/1875525.html
Copyright © 2011-2022 走看看