Run With Elevated Privileges

This is an example of how to establish a connection to the K2 server.

Reference
Microsoft.Sharepoint (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI\Microsoft.SharePoint.dll)

Code
Example 1: SPSecurity.RunWithElevatedPrivileges(delegate {   using (SPSite site = new SPSite("http://some-sharepoint-site-url"))    {        using (SPWeb web = site.OpenWeb)        {            // Now you can use 'web'        }    } }

Example 2 (for when you have a SPItemEventProperties properties in a SharePoint list item event receiver). SPSecurity.RunWithElevatedPrivileges(delegate {   using (SPWeb web = new SPSite(properties.SiteId).OpenWeb(properties.RelativeWebUrl))    {        // Now you can use 'web'    } }