I currently received a request in which the document/folder should be locked after (x)days (after the created date). Is it possible to enforce document/folder locking?
2 Answers
You can enable In Place Record Management Feature on your Site Collection, and configure the record declaration settings in such a way that those document which are declared as records are not allowed to be either edited or deleted (locked to be precise.) as shown below:
Go To Site Settings -> Site Collection Administration -> Record Declaration Settings
Set your Record Restriction as shown in the image below:
You can then restrict users from revoking the record declaration by setting the declaration roles as shown below:
Next, set up Information Management Policy Settings on your document library for the Content Types Document and Folder
Add a new retention stage and configure it as shown in the image below:
You should be able to achieve your requirement this way in a completely out of the box manner. Alternatively you write a Timer Job in order to achieve the same thing programmatically.
https://code.msdn.microsoft.com/office/SharePoint-2010-Declaring-bbeae3c3
You could certainly remove all the edit permissions from the document. Meaning people could then still read, but not modify. Of course you could remove all read permissions too, but I imagine your administrator would need visibility of this.