Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Security Exception For Custom Webpart

  Asked By: Tyler Collins         Date: May 06, 2003      Category: Sharepoint      Views: 308
 

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

Tagged:          

 

9 Answers Found

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

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, 2003       

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

www.bluedoglimited.com/.../ViewPost.aspx?id=99

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

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, 2003       

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, 2003       

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

---------------------------

output.Write(SPEncode.HtmlEncode(SPControl.GetContextWeb(Context).Name.ToString()));

--------------------------------

The Exception I am getting

---------------------------------

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

-------------

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

where are you keeping your dll?

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

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, 2003       

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

IISRESET

This will put the web  part in the GAC

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

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.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].