By hickory on
I've got a bunch of menu items, scattered throughout the Navigation menu, that should be hidden from anonymous users.
They all link to pages with URLs like 'my/*', where * is the name of the page, so Path Access would seem to be the best way to restrict access to those pages. Unfortunately, blocking access through Path Access doesn't remove items from the menu.
I can't put the menu items in a separate block and control the visibility of that block, because the items are nested under menu items that should be visible to everyone.
I could generate a static menu using PHP, but would rather not do that if possible. Is there another solution?
Comments
Menus
same problem with me..
addition: if you set the pages where a certain block will be displayed in a certain pages won't work.
is there a solution?
Life is short; Play Harder
one solution
Actually I found a way to do it: by making a view, accessible at the menu item's URL, that provides a menu item and is accessible only to authenticated users. Then altering template.php so that URL redirects to the intended destination, instead of showing the dummy view.
try this
There might be a module somewhere that does a better job but throwing this in your templates should work. Replace 1 with your menu id. BTW I learned this somewhere the handbook but I couldn't find it.
- China Business News & Observer -
old thread, same issue
I'm reviving this thread because I have the same need. I have created a page (containing a php snippet), which is intended to be accessed only by a specific authenticated role. I added a menu item, which should only appear in the navigation for that given role. However the link and page is accessible to everyone including anonymous users.
How can this be accomplished using only built-in Drupal functionality (no Views, etc.)? Adding a hard-coded condition to a template file would be an acceptable alternative in this case because the page node ID will never change.
Thanks in advance.
Update: I decided that since this is a permanent one-off page I'd simply roll the page into a function, giving me full access control at the module level.
Subscribing
i was trying to figure out a way to do that today, too.
I ran out of time and made a separate block.
Quint
www.Shalla.Net
Check the Menu By Role module
http://drupal.org/project/menu_per_role
.
--
( Evaluating the long-term route for Drupal 7.x via BackdropCMS at https://www.CMX.zone )
Required
Hi all
I too require this feature. I am using ACL to restrict content types so for example:
Staff Page
Senior Page
Public Page
when a user creates a new node i want it to hide the menu item for that node as well as its content based on the roles viewing it so for example a staff page is created by a user. When logged out the menu item and node is not visible to annonymous users (public) but is visible to staff and senior.
I hope this makes sense :-)
Any help on this would be great
thanks
GAMe
http://www.aprox.co.uk
All my problems resolved
Hi All
I was using a combination of ACL and TAC lite when all I needed to do was remove ACL and TAC lite and install Taxonomy Access control instead. Then created a permissions taxonomy with all my terms in there... ie. public, staff, senior, admins and then set who can view that type of content and TAC removes all traces of it from the site if the user doesnt have the rights to view that content. so thats all links in views and menu items gone :-) woo ha! after i sat down and played for a bit i was lead back to the KISS (Keep It Simple Stupid) rule ;-). Anyways I hope this helps others with their menu woes and content access. Now if i can setup some kind of action to unpublish public content when created/updated I will be a very happy man :-)
Cheers all
GAMe
http://www.aprox.co.uk