Yasine LAKHDARI

Yasine LAKHDARI

  • NA
  • 71
  • 47.6k

SharePoint Permissions

Mar 12 2009 5:53 AM
Hello,
 I have an other problem with SharePointPermission
I added the following simple code whitch triggers the list Associated Workflow:

SPSite site = new SPSite("http://intersticedev/hr");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Quitus"];
SPListItem item = list.Items.Add();
//
item.Update();
list.Update();
 SPWorkflowManager wkfManager = item.Web.Site.WorkflowManager;
SPWorkflowAssociation myWkrAssociation = list.WorkflowAssociations[0];
wkfManager.StartWorkflow(item, myWkrAssociation, "", true);
//

This code snippet was tested on Windows Application on the server and it was successfully excuted.
When i created a WebPart and i inserted the same code for associated Workflow starting it generate the following exception:
Request for the permission of type :
'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed.

the insertion of the ListItem is successful but the line of Workflow Starting cause problem.
notice that i have changed the WSS_Mini to WSS_Medium

please what's the problem ?

Best Regards.
Thanks !


Answers (1)