A colleague was getting as SecurityException while running a .Net WebPart (MS-speak for portlet) under SharePoint. We poked around to figure out how to grant permissions to WebParts. The usual .Net config editor approach didn't work. After a bit of googling, we turned up:
Microsoft Windows SharePoint Services and Code Access Security