Updating WebPart Properties Using RunWithElevatedPrivileges in MOSS 2007
As part of a MOSS 2007 solution, I have a web part that displays the "term" of the day. The terms are stored in a horribly messy XML file, so everything is parsed and then supposed to update the LastUpdatedOn property to the current time.
My problem is that admin level accounts can see this without any problem, but viewers get an error stating that they do not have enough rights to save the properties of the web part.
I run the code in an elevated delegate and create a new context to get around the fact that the context still thinks the current user is not a system account.
You can paste the full code here
Problem lines:
SaveProperties = true;
LastUpdatedOn = DateTime.Now.ToString();
A note about this means that my web part is working, but it will always display a random term on every page load, instead of keeping the same term for 24 hours.
a source to share