There are one solution that I have tried , and one other that I have read. You can check if those many be of some help.
a) There is a setting on the Sharepoint server that does not allow to run web parts deployed in Bin with the required higher priveleges. You should "move" the web part to Global Assembly Cache (GAC). You can just drag and drop in GAC. You should also not forget to delete the assembly from your current bin folder. The run time will then check GAC instead of local bin first. Please reset IIS after you move the asssembly to GAC.
b) By default, the sharepoint web.config has the trust level set to minimum. You may choose to override in this case. open the wss_mediumtrust and the wss_minimaltrust.config files. Take a backup of the files and then do the following modifications. Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\xx\config\ folder and copy-paste the nodes from wss_mediumtrust.config files.
a) Security Class
Look for this error on the web,and you will find the exact node xml to be copied.
Hope this helps.