I have generated (programmatically) a web part for my site. It was
created at user-login when the user had permissions to view the
web-part control, but the control wasn't already a part of their
viewable list.
if (/* User has permission */ ... )
{
// Load the add-on...
Control uc = this.LoadControl(DB.GetValue("AddOnFile"));
uc.ID = DB.GetValue("AddOnName");
GenericWebPart wp = MyWebPartManager.CreateWebPart(uc);
wp.Title = DB.GetValue("AddOnName");
wp.ChromeState = PartChromeState.Normal;
MyWebPartManager.AddWebPart(wp, this.AddOns, 0);
}
Now.... I've removed permissions from the user for that control for
that user. However, because they had permission to it before it is
still a part of their WebPart list for their page.
How do I programmatically remove it???