As you may know, if a user has 'view content revisions' permission, Drupal adds tabs to the node view if the node has revisions: "View" and "Revisions". This module hides the "Revisions" tab if the content does not belong to the user, but the "View" tab still shows up (which is renamed to "View published"). How can we also hide the "View" tab? Maybe alter the page callback for node/%node/view or hook_menu_local_tasks_alter?
Here's permissions for authenticated user on my site:
view published content
view own unpublished content
view content revisions
Article: create new content
Article: edit own content
Article: delete own content
View the moderation messages on a node
Use "My Drafts" workbench tab
Moderate all content from Draft to Needs Review
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | workbench_moderation-hide-view-tab-1691594.patch | 619 bytes | jonraedeke |
Comments
Comment #1
jh81 commentedI have a similar issue. On my site authenticated users have right to:
Node -> View published content.
Node -> View own unpublished content
Node -> View content revisions
but no Workbench Access and Workbench Moderation rights at all. I have that setup so they can upload documents in a unpublished state that an admin can review and publish outside of Workbench. With those 2 checkboxes checked, authenticated users see a "View Published" tab on published pages. Any way to get rid of that tab?
Comment #2
Sborsody commentedI haven't had time to delve into this deeper. For now I've just hidden that tab completely!
Comment #3
timwoodSborsody,
Can you expand on how you hid the tab?
Thanks!
Comment #4
Sborsody commentedBy implementing hook_menu_local_tasks_alter() in a custom module. I basically copied what is found in workbench_moderation_menu_local_tasks_alter() and referenced the View tab.
Comment #5
jonraedeke commentedCore (menu.inc) doesn't show single tabs, but this check gets missed since the wb doesn't revise the tabs count after removing the revisions tab. Here's a patch for 7.x-1.x.
Comment #6
Anonymous (not verified) commentedTested this, works for me.
Comment #7
mrprasa commentedTested on workbench moderation 7.x-1.4. Works great!