Agusto Xaverius P Sipahutar

Job:Making some bugs and patch
Moss/Wss,C#,Sql Server,WWF,K2.BlackPearl
Motto : Keep Study and study
See also: Other Geeks@INDC

News




MCP Logo
MCTS Logo

MCP ID# 3542391

My Curiculum Vitae


Agusto Xaverius P S's Facebook profile

Other Article

My Community

My Article/Share Knowledge

Others Moss/Wss Site

My Other Website/Blogs

My Share (Ebook,etc)

Impersonate at WSS 3.0

using (SPWeb web = new SPSite("http://demo:2100").OpenWeb()  )
{
         SPUser spUser = web.AllUsers[@"mydomain\agusto"];
         SPUserToken token = spUser.UserToken;

         //di sini SPSite sudah di impersonate base on user --> spUser
         using (SPSite impSite = new SPSite("http://demo:2100", token))
         {
                 SPWeb web1 = impSite.OpenWeb();
                 SPList list = web1.Lists["sampleList"];
                 SPListItem item = list.GetItemById(1); //get item base on user impersonate
         }
}

 

Share this post: | | | |
Posted: Oct 14 2008, 11:52 PM by agusto | with no comments
Filed under:

Comments

No Comments