You are here

function edit_limit_menu_alter in Edit Limit 7

Same name and namespace in other branches
  1. 6 edit_limit.module \edit_limit_menu_alter()

Implements hook_menu_alter().

This allows additional checks to be made for granting access checks. For instance, the node menu items use node_access() to grant permissions to edit nodes, but we want to not only check that, but also check to see if the user is allowed to continue making edits.

File

./edit_limit.module, line 64
edit_limit.module Primary module file for Edit Limit. This contains all the hooks needed to run the module.

Code

function edit_limit_menu_alter(&$items) {

  // node_access() overrides
  $items['node/%node/edit']['access callback'] = 'edit_limit_node_access';

  // Override comment edit access checks
  $items['comment/%comment/edit']['access callback'] = 'edit_limit_comment_access';
}