質問

I've created an app (add-in) in Visual Studio for SharePoint 2013 with a workflow. The workflow works fine, but when the workflow is running; the document can be updated, deleted,...

How can I lock that document when the workflow starts and unlock the document when it ends?

役に立ちましたか?

解決 2

I had to break the permissions from the item and at the end I reset the permissions again.

I did this with a REST request:

  1. /ListItemAllFields/breakroleinheritance(false)
  2. /ListItemAllFields/roleassignments/addroleassignment(principalid=1 , roledefid=2)
  3. /resetroleinheritance

他のヒント

You need to break permissions of the item to achieve your requirement.

Step 1 :

When item is triggered for approval process, add impersonation step in your workflow and provide read permissions to all accept approvers (if required)

Step 2 :

When your item completes approval process(approved or rejected), provide back the previous permissions to the current item

Hope this solves your issue. Below are some reference links :

Lock item when approval starts

How do I stop users changing a document going through approval workflow?

ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top