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

Comments

jh81’s picture

I 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?

Sborsody’s picture

I haven't had time to delve into this deeper. For now I've just hidden that tab completely!

timwood’s picture

Sborsody,
Can you expand on how you hid the tab?

Thanks!

Sborsody’s picture

By 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.

jonraedeke’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new619 bytes

Core (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.

Anonymous’s picture

Tested this, works for me.

mrprasa’s picture

Tested on workbench moderation 7.x-1.4. Works great!