0

I want to disable the Delete option from the Version History Page.

enter image description here

I have already gone through this link, but I do not want to achieve this task by modifying existing permissions. Everyone will have Contribute level of permission, but I don't want any user to delete any version.

Is it possible? If yes, then suggest me the way. Any reference link would also be fine.

1 Answer 1

2

There are couple of approaches that you can try.

1. Hide the element

Use Chrome inspector to find the exact class/ID for the 'Delete' versions link and then hide it using CSS. You need to add this CSS to all the pages (probably adding it to a master page will be a good idea). You will also have to take care of 'Delete All Versions' link.

2. Override JS function

From Chrome inspector I can see that 'Delete' versions link calls JS function DeleteVersion. You can override it by using below sample code.

var oldDeleteVersion = DeleteVersion;
function DeleteVersion() {
    alert("Deleting versions is not allowed.");
}

Again, you need to add this JS to all the pages (probably adding it to a master page will be a good idea). You will also have to take care of 'Delete All Versions' link.

Also, may I ask why you cannot modify existing permissions? That will not only be the easiest, but also the recommended option. The options that I have suggested will require you to thoroughly test as you are overriding what is provided by SharePoint.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.