Revision rights by content type

I needed to allow revision viewing and reverting (but not deleting) for only one content type (a wiki). The solution turned out to be in hook_menu and module weights, and overriding Drupal's menu structure for the revisions of wikis.

Basically another set of paths is created that read node/$nid/wiki-revision/$vid and all callbacks for wiki content types flow through newly defined callbacks. They're mostly cribbed from node.module, but have an additional OR permission of user_access('edit wiki content'). Permission to delete revisions stays with user_access('administer nodes'). The modules also depends on having a lighter system weight than node.module.

The complete module is attached below.

AttachmentSize
revisionary.zip2.93 KB

My name is Sam and I’ve

My name is Sam and I’ve been on a health journey for nearly 10 years. And at last iphone thank goodness - I feel like I'm finally healing. cell phonesAs I journey toward vibrancies in body, mind, and spirit, I'll share ideas and stories that may help you along your path.solutions And I'd love to hear your stories too!

another possible approach

http://paul.leafish.co.uk/articles/drupal/simple_permissions_for_uploads...

This deals with file uploads, but it seems like it could be adapted to work for revisions perhaps.

Does it handle hiding or showing the revision tab?

Will the module take care of the revision tab, does it use a different way of linking to the wiki, or...?

Also, the module is not yet attached, on not visible!

Thanks for making it and making it available.

benjamin, Agaric Design Collective

Yup

It will show/hide the revision tab just like normal.

I've set up a project at http://drupal.org/project/revisionary to host it. It was attached above but I'd forgotten to give anon visitors rights to download files.

Also, thank you for being the first commenter on my blog.