Removing a version “restore” option in a document workspace
Posted by sNjY on August 21, 2008
This is very common that versioning is enabled in a doc lib to create a version of each edit. This helps to trace the changes of a document metadata and is a very useful feature.
How to view item versions:
On click of the context menu item “Version History” in a document, system redirects to Versions.aspx (a layouts page) . Versions.aspx pulls all the versions for the current document and displays.
How to view restore option and who can resotre:
In this page, user who has a add/edit/delete permission on the document, can resotre a particular version. “Restore” is an option provided as a context menu item on each version item.
Removing restore option for all users:
I took this approach, which is good and working. If you have any other way of achieving this please lemme know.
I noticed that the restore option was not shown for a user who has only view permission on the document. Then i saw through the application page Versions.aspx. In this page, the current user’s effective base permissions on a item is passed to the system. The options in the context menu are filtered based on those permissions. I then found out the effective base permission on a item for a user who had only view permissions. Next, i hardcoded those permissions and checked, the restore option was gone as system interpreted that the logged in user has view permission only. I also ensured that this change would apply for my document workspace alone, as Versions.aspx is an application page and other sites in the farm can use it too. Following is the piece of code, i modified on the page (versions.aspx)
Id=
Perm=
<% } else { %>
Perm=
<% } %>



Recent Links Tagged With "contextmenu" - JabberTags said
[...] links >> contextmenu 鳥獣保護区 | OnMyCommand の記事 Saved by keene on Thu 18-12-2008 Removing a version “restore” option in a document workspace Saved by mimypsycho on Sat 06-12-2008 Add “Take Ownership” Option to the Windows Vista [...]