开发者

linq to sharepoint datacontext ignore user permission

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜