I've recently been having some problems getting hold of a UserProfileManager (a = new UserProfileManager(elevatedContext, true)) - getting an unauthorizedaccessexception. This doesn't happen when i'm logged in as an admin user (perhaps obviously)
I've read a lot about runwithelevatedprivileges and i'm pretty sure that i'm doing it right - can you anyone help me get this userprofilemanager (and do the various other tasks I can't do (as in my example with the requestedProfile.colleague.create)??? I
can't find a way around it!
// The relationship should be two way, to add a colleague for another user we need to elevate
using (SPSite site = new SPSite(unprivSite.ID))
site.AllowUnsafeUpdates = true;
View Complete Post