Alter permission based on path.


Sometimes you want to alter the permission for a certain path, to make it more specific for a certain role. Implementing the hook_menu_alter() is a quick way to do that.

Get raw version
  1. /**
  2.  * Implements hook_menu_alter().
  3.  */
  4. function MYMODULE_menu_alter(&$items) {
  5. $items['admin/dashboard']['access arguments'] = array('Display Drupal links'); // Or any other permission.
  6. }