You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Lock a file in the repository

posted on May 13, 2021

A customer has asked if there is a way to Apply a Lock to a Document so it can’t be edited until the lock is released. They do not want to Check it out, as some file types are saved locally during the checkout process, or put on Hold as it affects the retention. Or to change the security of the system, but to just change the document to Read only/locked.
 

Thoughts?

 

0 0
replied on May 13, 2021 Show version history

Create a workflow Business Process that runs an SDK script locking the Starting entry. Or have workflow trigger based on a metadata field change (Like "Locked"="Yes/No").

Relevant code snippet below. When and how you call Unlock() depends on how the customer wants to lift the lock.

using (DocumentInfo docInfo = (DocumentInfo)this.BoundEntryInfo){
	docInfo.Lock(LockType.Exclusive);
	#docInfo.Unlock();
}

Update: this approach probably won't work for what you want because the lock won't persist between script instances. Having Workflow Check-Out and later Check-In the entry is a more viable route as it will create a persistent lock between those events.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.