[support] Pages with restricted access and menu entries.

Jason Flatt drupal at oadae.net
Sun Sep 24 19:52:32 UTC 2006


On Saturday 23 September 2006 13:41, Martin Tomes wrote:
> I have defined a page type for pages which should be hidden from
> anonymous users by writing my own module (an edited copy of page.module)
> and have set permissions so that only users in specific roles can read
> those pages.  My problem is that if I add that page to a menu that menu
> entry is shown to anonymous users and I would like it to be hidden from
> them (they get permission denied on clicking on the menu entry) and only
> shown to logged in users with view permission.  Is there any way to
> achieve this?
>
> --
> Martin Tomes.

Do you have something like this as part of your menu array?:

'access' => user_access('access special page type'),

There are many examples in the core modules in hook_menu functions.

-- 
Jason Flatt
http://www.oadae.net/
Father of Six:  http://www.flattfamily.com/ (Joseph, 13; Cramer, 11; Travis, 
9; Angela; Harry, 5; and William, 12:04 am, 12-29-2005)
Linux User:     http://www.sourcemage.org/
Drupal Fanatic: http://drupal.org/


More information about the support mailing list