I've spent the last two days trying out various access control modules and seem to be getting close to a solution using contributed modules... however I have one core issue with most of them: menu items are hidden until the user is logged in, and only then can they see the menu items.

I would like menu items to stay enabled, despite having the content inaccessible. I'm using the logintoboggan module to present visitors with a friendly 'you need an account to view this content' page, but they will never see it because the menu item leading visitors to the secure branch of the site is hidden.

The Menu Item Access module seems to come close to answering this issue, as it keeps the menu items visible, but I'm having a hell of a time trying to work out the correct combination of menu permissions to avoid anonymous users being locked out of all site content.

I have tried applying the Taxonomy Access Control module which restricts access to content tagged as 'private', but the menu items for these items disappear when the tag is applied.

If there is a simple way to get Taxonomy Access Control to stop hiding menu items, it would be perfect for this project. Has anybody managed to do this before? Is there a quick bit of code that might override this behavior?

Comments

sydneyshan’s picture

By moving the restricted content back a level in the website's menu hierarchy I can retain the top-level link to the restricted website branch. This top-level link would then become an overview page of the restricted content with instructions on how to register for access or login.

I'm still curious to know how to make menu items stay visible despite the visitor not having access to view their contents.

Any thoughts on how to force menu items to stay visible would be great!

rkdeveloper’s picture

simple solution is to create a block with all links you want to display,enable that block to roles.

scenario

i have created a block that displays create page link to anonymous users. but they dont have access create a page. i used login to bogan module which displays login form in all access denied pages.

if i understand correctly this solution will help in your scenario.

want to hear more suggestions from drupalers.

Hammad Ghani’s picture

Thank you so much, great and simple solution.

shafqat1982’s picture

It is so easy, you don't need to install or learn to something to do it. Just create a new Menu item and give full URL in path field now this menu will be visible whether content is restricted or not.

for example Full URL:http://drupal.org/node/724978" not like this "node/724978".

You can also use this module for better solution:
https://www.drupal.org/project/always_visible

steven-spencer’s picture

Great and simple solution! thx

hixster’s picture

This looks like a good solution except that the menu item wont get the "active" class.

Drupal Web Designers Surrey South East England www.lightflows.co.uk

Hammad Ghani’s picture

Thank you so much great and simple solution.

mthomas’s picture

pelicani’s picture

this is an awesome solution.
thank you.

peace,
michael

Technical Architect : Philadelphia, PA