I am using Content Access module with Drupal 7. when i restrict node access from a specific role, it also hide link in menu.
is there any way to show restricted links in main menu?
|
I am using Content Access module with Drupal 7. when i restrict node access from a specific role, it also hide link in menu. is there any way to show restricted links in main menu? |
||||
|
I have did this via custom module:
|
|||
|
|
|
The main purpose of the access content system is to have control of what every user can see and avoid every possible security issue. This is the desired behavior and almost every module or general ApI uses it, so you won't find default solutions for this. I've been in the same situation and the only solution I found was to create a custom modules and, in my case, query directly to the menu table to get all the elements I want, and check the permissions myself to either display a link, or simply a title of the content when the user don't have permissions to see it. |
|||||
|
|
I'm pretty sure you will have to write a custom module to deal with this. Here's my idea: relax Content Access restrictions, i.e. let users view your content. Then your custom module has to implement hook_node_load() and output a 403 HTTP response when loading nodes your users should not see. Also hook_permission() should be implemented, so you will be able to configure access easily at the permission page. Here's a quick example hiding the entire node and filtering by content type and permission:
Or you can hide some of the node fields, instead of returning a 403. But this is discouraged according to API documentation for hook_node_load() |
|||
|
You can use "Always visible" module. More detailed answer on your question is here http://drupal.stackexchange.com/a/52149/7313 |
|||||||
|
admin/structure/menu/manage/main-menu/add? – develkar Dec 6 '12 at 14:07