Index: modules/contact.module =================================================================== RCS file: /cvs/drupal/drupal/modules/contact.module,v retrieving revision 1.47 diff -u -b -F^f -r1.47 contact.module --- modules/contact.module 23 Mar 2006 09:29:35 -0000 1.47 +++ modules/contact.module 10 May 2006 08:57:36 -0000 @@ -38,6 +38,12 @@ function contact_help($section) { } /** + * Implementation of hook_perm + */ +function contact_perm() { + return array('access site-wide contact form', 'access personal contact form'); +} +/** * Implementation of hook_menu(). */ function contact_menu($may_cache) { @@ -89,16 +95,18 @@ function contact_menu($may_cache) { $items[] = array('path' => 'contact', 'title' => t('contact'), 'callback' => 'contact_mail_page', - 'access' => user_access('access content'), + 'access' => (user_access('access content') && user_access('access site-wide contact form')), 'type' => MENU_SUGGESTED_ITEM, ); } else { if (arg(0) == 'user' && is_numeric(arg(1))) { + global $user; $items[] = array('path' => "user/". arg(1) ."/contact", 'title' => t('contact'), 'callback' => 'contact_mail_user', 'type' => MENU_LOCAL_TASK, + 'access' => ($user->uid && user_access('access user profiles') && user_access('access personal contact form')), 'weight' => 2, ); }