I need to restrict the access to certain content types for some roles, but I still need the menu items of the restricted content to be visible for every user. Currently, if a user role is restricted to a content type, this module will not allow that user to see the items.
I need that they SEE the menu items; so they can click on them (I need users to be aware of what they "miss out" if they don't register) and be redirected to log-in form -- (via Login Toboggan, but that's another story).
Maybe this is out of scope for this module, but there might be a hook I can implement in a module apart to modify the workings of Content Access and make these links "visible" again, regardless of permissions.
Thank you!
Comments
Comment #1
alextronic commentedbumpy post
Comment #2
drupahell commentedsubscribing (feature request?)
Comment #3
vadimk commentedThis is a Drupal limitation (or feature). It looks like Drupal does not allow pulling menu links for nodes that user does not have access to.
These are the options I can think of:
1) Deal with it.
2) Hard-code the menu links in your template. This is not a good solution if your menu needs to be dynamically populated and requires the Drupal menu features.
3) Hack approach. Copy and rename the Drupal menu functions (menu_navigation_links(), menu_tree_page_data(), menu_tree_check_access(), _menu_tree_check_access(), and _menu_link_translate()) and modify them removing the code where it does menu item access checks (if ($item['access']) {). Then you can use the new functions for your needs. However, remember this is a hack. Who knows if this may break with a newer Drupal version.
4) Create your own function for pulling menu links.
5) Implement a different access_content module. It would behave similarly to this one, but it would not use hook_node_access_records() for setting node permissions.
Comment #4
keilo commentedThis would be a very useful feature. Show restricted items in menu.
Comment #5
keilo commentedComment #6
eusofzay commentedHas anybody found a solution for this problem or not?
I don't know why is this feature ignored in the drupal community. Everyone needs it, but still ignored.
Comment #7
MasterChief commentedI would like to know too :)
Comment #8
shafqat1982 commentedIt 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.
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
Comment #9
DrewMathers commentedYou could also allow restricted users to see titles and teasers only, but not full nodes using Premium
Comment #10
vadimk commented1) This solution adds additional manual work. For each node that you create or delete, you need to create or delete a menu item separately from the node (on a different page). If your node path depends on menu title, you need to update the path alias manually, too. This may be easy and fast for you. But it could be time consuming and annoying for someone else.
2) With this solution, the breadcrumbs are not set if they depend on the menu.
3) If you move to a different domain address, you would need to update all your menu links with absolute paths.
4) If your site is located at multiple domain addresses, good luck managing all your menu links with absolute paths.
Comment #11
mthomas commentedBump.
Comment #12
mthomas commentedSee also: http://drupal.org/node/723964 and http://drupal.org/node/300607
Comment #13
mthomas commentedI'm sorry to spam this thread, but I made a sandbox project of out my solution: http://drupal.org/sandbox/mthomas/1119418
Comment #14
grasmash commentedThanks for the sandbox module! It's works great.
Comment #15
good_man commentedIt's out of the scope of this module, I guess you either use mthomas' sandbox or wait for the entity access module which will cover it AFAIK.
Comment #16
timtunbridge commented#13 worked for me!
Comment #17
MasterChief commentedI confirm #16, thank you for your work mthomas :)
Comment #18
stoptime commentedThanks a mil mthomas!
Comment #19
elvin - albania drupal developerYOU ARE A LIFE SAVER
THANK YOU SHAFQAT - THIS WAS SO EASY :d
Comment #20
jrstmartin commented@shafqat1982, YOU'RE THE MAN!
Comment #21
d3vo commentedThis was an excellent suggestion as I only needed this for one simple create content link. Then i can use rules to redirect my users to login to submit this content.
Thanks shafqat1982
Comment #22
alfonsobarreiro commentedSolution #8 worked for me.
Thank you!
Comment #23
gopnik commentedThank you mthomas it's work!