C
christoph.hanser
Hi!
We're having problems with the method SPListItem.moveTo().
A InfoPath document and stored inside the a SharePoint library.
Afterwards, it is modified using a workflow that runs inside the
Workflow Foundation. This workflow makes some changes inside the
document and stores it in another SharePoint library. There, special
permissions are set to enable different users access to the document.
In the end, the document is moved back into the original library. The
document is not stored immidiatelly inside the original library in
order to set the permissions. The code looks like this:
Dim mst As New MemoryStream
Dim sFilename_1 As String = it.ParentList.Title &
"_Temp/" & sGuid & ".xml"
Dim sFilename_2 As String = it.ParentList.Title & "/" &
sGuid & ".xml"
xmlout.Save(mst)
Dim file As SPFile =
it.ParentList.ParentWeb.Files.Add(sFilename_1, mst, True)
' Berechtigungen initialisieren
Berechtigungen_Initialisieren(file.Item)
' Berechtigung für Rollenmitglieder setzen
Berechtigung_Setzen(file.Item, ds)
file.MoveTo(file.ParentFolder.ParentWeb.Url & "/" &
sFilename_2)
It works really good as long as the administrator of the machine runs
the script. However, when other users run the process, an exception is
thrown when performing the MoveTo() method:
bei Microsoft.SharePoint.Library.SPRequest.MoveUrl(String bstrUrl,
String bstrWebRelOldUrl, String bstrWebRelNewUrl, Int32 grf)
bei Microsoft.SharePoint.SPFile.MoveCopyInternal(String strNewUrl,
Int32 grf)
bei Microsoft.SharePoint.SPFile.MoveTo(String newUrl,
SPMoveOperations flags)
bei Microsoft.SharePoint.SPFile.MoveTo(String newUrl, Boolean
bOverWrite)
bei
eav_workflow_functions.WorkflowFunctions.Einzelantrag_Speichern(SPListItem
it, XmlDocument xml, String guid)
It seems that they do not have the right to overwrite the document.
How can we give all users theses rights?
It does not help to grant them "full access" (Vollzugriff) in
SharePoint.
Also, the idea to run the Update() Methode came to our mind... However,
this works only for list libraries and not for form libraries.
We're having problems with the method SPListItem.moveTo().
A InfoPath document and stored inside the a SharePoint library.
Afterwards, it is modified using a workflow that runs inside the
Workflow Foundation. This workflow makes some changes inside the
document and stores it in another SharePoint library. There, special
permissions are set to enable different users access to the document.
In the end, the document is moved back into the original library. The
document is not stored immidiatelly inside the original library in
order to set the permissions. The code looks like this:
Dim mst As New MemoryStream
Dim sFilename_1 As String = it.ParentList.Title &
"_Temp/" & sGuid & ".xml"
Dim sFilename_2 As String = it.ParentList.Title & "/" &
sGuid & ".xml"
xmlout.Save(mst)
Dim file As SPFile =
it.ParentList.ParentWeb.Files.Add(sFilename_1, mst, True)
' Berechtigungen initialisieren
Berechtigungen_Initialisieren(file.Item)
' Berechtigung für Rollenmitglieder setzen
Berechtigung_Setzen(file.Item, ds)
file.MoveTo(file.ParentFolder.ParentWeb.Url & "/" &
sFilename_2)
It works really good as long as the administrator of the machine runs
the script. However, when other users run the process, an exception is
thrown when performing the MoveTo() method:
bei Microsoft.SharePoint.Library.SPRequest.MoveUrl(String bstrUrl,
String bstrWebRelOldUrl, String bstrWebRelNewUrl, Int32 grf)
bei Microsoft.SharePoint.SPFile.MoveCopyInternal(String strNewUrl,
Int32 grf)
bei Microsoft.SharePoint.SPFile.MoveTo(String newUrl,
SPMoveOperations flags)
bei Microsoft.SharePoint.SPFile.MoveTo(String newUrl, Boolean
bOverWrite)
bei
eav_workflow_functions.WorkflowFunctions.Einzelantrag_Speichern(SPListItem
it, XmlDocument xml, String guid)
It seems that they do not have the right to overwrite the document.
How can we give all users theses rights?
It does not help to grant them "full access" (Vollzugriff) in
SharePoint.
Also, the idea to run the Update() Methode came to our mind... However,
this works only for list libraries and not for form libraries.