开发者

linq to sharepoint datacontext ignore user permission

开发者 https://www.devze.com 2023-02-08 07:17 出处:网络
I\'m useing \'Linq to SharePoint\' and when I get a SharePoint context the list is empty (user haven\'t permission to this list).

I'm useing 'Linq to SharePoint' and when I get a SharePoint context the list is empty (user haven't permission to this list).

using (Sy开发者_如何学PythonstemOcenContextDataContext ctx = new SystemOcenContextDataContext("url"))
{
    // my code
}

I have tried something like this:

SPSecurity.RunWithElevatedPrivileges(delegate()
{
    using (SystemOcenContextDataContext ctx = new SystemOcenContextDataContext("url"))
    {
        // my code
    }
});

but the context lists are still empty :( Any ideas?


this is another bug :) I find solution:

http://blogs.msdn.com/b/sowmyancs/archive/2010/09/19/linq-to-sharepoint-and-runwithelevatedprivileges.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消