drupal - function hook_menu_alter on metatag module -


i have 2 users on drupal7 website(client , user1(admin)). i'd client user, using metatag module has access 1 tab(by path tab) or metatag:context node. if use function hook_menu_alter:

function module_menu_alter(&$items) { $items['node']['access callback'] = false;  } 

will deny client user use other tabs of module?

so function this

function metatag_menu_alter(&$items) { $items['admin/config/search/metatags/settings']['access callback'] = false;  } 

correct me if im wrong.

thanks!

the hook_menu_alter not know context of user, function there deny access users page admin/config/search/metatags/settings wanting define callback function. piece called "access callback" because menu router calls listed function determine access @ time visiting page.

function metatag_menu_alter(&$items) {   $items['admin/config/search/metatags/settings']['access callback'] = 'metatag_admin_access';  }  function metatag_admin_access() {   global $user;   if( [check metatag context] ) {     // user permitted     return true;   }   return false; } 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -