Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Security Exception For Custom Webpart

  Asked By: Tyler    Date: May 06    Category: Sharepoint    Views: 1054

I Develop one webpart and installed in GAC . In that webpart i have used SPGlobaladmin class to list the virtual servers .

The webpart contains one textbox and one button , The web part is displaying but when I am clicking the button I am getting

following security exception



9 Answers Found

Answer #1    Answered By: Joe Hart     Answered On: May 06

The the Trust level, as a temporary set the trust level in the web.config to Full

Answer #2    Answered By: Jorge Cole     Answered On: May 06

Does anyone have any views on GAC vs bin installs .....I am not technical really but from day one all of the simple "set trust to full" or install in GAC seemed to be slightly missing the point and my concerns were further raised when reading this


Answer #3    Answered By: Rodolfo Tate     Answered On: May 06

First of all thanks for reply
The dll is in GAC , but same exception
I even changed the trust level to Full also ......same exception

Answer #4    Answered By: Rickey Strickland     Answered On: May 06

I think it might depend on what you are trying to do. If you are trying to access certain admin level stuff in the object model, but the webpart  is running under only a reader role then you will have a problem. You might need to impersonate the webpart to run under an admin account.

Answer #5    Answered By: Jonathan Thompson     Answered On: May 06

When I am trying to access sharepoint object model I am getting exception  . just I am getting the context of the site.


//Code I have written




The Exception I am getting


Request for the permission of type Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c failed.


Answer #6    Answered By: Taylor Mills     Answered On: May 06

where are you keeping your dll?

Answer #7    Answered By: Angel Jordan     Answered On: May 06

I created one cab project and by using stsadm command I add the cab
project to portal

Stsadm -o addwppack -filename "........" -url http://hostname

Answer #8    Answered By: Darrell Peters     Answered On: May 06

Stsadm -o addwppack -filename "........" -url http://hostname -force


This will put the web  part in the GAC

Answer #9    Answered By: Lester Casey     Answered On: May 06

Previous I done the same thing.

Didn't find what you were looking for? Find more on Security Exception For Custom Webpart Or get search suggestion and latest updates.