Drupal 7 - Node Gallery visible for logged users only

138 views Asked by At
  1. I have Drupal 7 with NodeGallery installed. I have several galleries in on my website.
  2. Some of those galleries are linked to the main menu items and always visible and some of those are linked to menu items visible only after the user has signed up.
  3. But when someone is logged-in and for example sends a link to gallery (like http://my.site.com/?q=node/1477), that is hidden for external (unlogged) users, they see that gallery, although they don't see it in main menu.

The option in Content management (for this gallery) "Is private" and the combo box "Authenticated only" has no effect (has effect only with the visibility of the link in main menu). If someone knows the link, he has access to the gallery. That is not desirable.

How can the permissions of view of the concrete gallery be restricted to only authenticated user?

1

There are 1 answers

1
Viswanath Polaki On

For controlling the logged in and logged out menu items you can use menu item visibility module URL: https://www.drupal.org/project/menu_item_visibility where you can control which menu item is visible to which role.

And you can use hook_node_view hook to check which node(s) to be visible to which roles of user or you can use nodeaccess module to have a backend to make your node visible to which user URL: https://www.drupal.org/project/nodeaccess

Thanks