Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

SPS Security error - can't modify database

  Asked By: Rusty Patrick         Date: Sep 17, 2009      Category: Sharepoint      Views: 293
 

I am doing some SPS custom coding using APIs available in WSS Object
Model.

The code involves modification of sharepoint databases, but the
moment I run the code, I am getting run time security error:

"Updates are currently disallowed on GET requests. To allow updates
on a GET, set the 'AllowUnsafeUpdates' property on SPWeb. "

Then I set the 'AllowUnsafeUpdates' of SPWeb to "true", but even
then SAME problem.

How to modify the request to POST from GET? where should I make this
change?


Here is my code:
---------------------------------------------------------
SPWeb mySite = SPControl.GetContextWeb(Context);
mySite.AllowUnsafeUpdates = true;

SPUser user = mySite.CurrentUser;

SPWebPartCollection allWepParts = mySite.GetWebPartCollection
("http://fmsudrs01.fm.intel.com/document%
20library/eSales.aspx",Microsoft.SharePoint.WebPartPages.Storage.Pers
onal);

allWepParts.DeleteAllPersonalizations(user.ID);
--------------------------------------------------------


"allWepParts.DeleteAllPersonalizations(user.ID);" is the line which
is giving the error.

Tagged:            

 

1 Answer Found

 
Answer #1       Answered By: Satyajit Kabadagi          Answered On: Sep 17, 2009       

I can't help you with your specific problem, but I may
be able to help you otherwise.

I'm reperesenting a client who needs a sharepoint
V.2003 experienced person for a job paying up to $100K
in the Baltimore, MD area.

 
Didn't find what you were looking for? Find more on SPS Security error - can't modify database Or get search suggestion and latest updates.


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