Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
"access callback": A function returning a boolean value that determines whether the user has access rights to this menu item. Defaults to user_access() unless a value is inherited from a parent menu item..
The part "[...] unless a value is inherited from a parent menu item.." is not really right since http://drupal.org/node/244637 or can lead to misunderstand
Comment | File | Size | Author |
---|---|---|---|
#8 | callbacks_arent_inherited-975754-d6-8.patch | 866 bytes | Albert Volkman |
#3 | 975754.patch | 3.73 KB | jhodgdon |
Comments
Comment #1
jhodgdonI see where that security announcement says that access callbacks are not inherited. Presumably this is true in D7 as well, and the doc should be fixed there first.
I would like to see someone verify in the menu building code that this fix is still in effect before we change the doc though.
Comment #2
jhodgdonUpdating title. Still needs to be investigated for D7 and D6, to verify whether the doc is correct or not (the doc says access callbacks are inherited).
Comment #3
jhodgdonAnother note: the menu system topic/group (which is located at the top of menu.inc) also says that access callbacks are inherited. So if this is wrong, we need to fix it there too.
In Drupal 7, it looks like access callbacks are inherited, but only for MENU_DEFAULT_LOCAL_TASK items. Here's the relevant code from _menu_router_build():
This is identical in Drupal 6 as well, and is explained here (the change was made in **Drupal 6.2** and this has been wrong in the documentation since then!): http://drupal.org/node/244569
So the doc does need an update... here's a patch. If accepted, it also needs to be ported to Drupal 6.x.
Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedLooks good. Please move to d6 after commit.
Comment #5
webchickCommitted to HEAD. Thanks!
Comment #6
jhodgdonPatch should be ported now to D6, which works exactly the same.
Comment #7
webchickSorry. I meant to do that, had a brain-fart.
Comment #8
Albert Volkman CreditAttribution: Albert Volkman commentedSmall D6 patch :)
Comment #9
jhodgdonThanks! That patch looks good for Drupal 6.
We also need a patch for that fixes up the hook_menu() example (in D6, hook docs are in the Documentation project repository). If you are interested in doing that, you could attach it here -- just give it a file name that will make the test bot ignore it (see note below the Attach new file field when you attach the file).
Comment #10
Albert Volkman CreditAttribution: Albert Volkman commentedIt looks like the hunks for system.api.php are already in developer/hooks/core.php in the documentation project. Refs-
http://drupalcode.org/project/documentation.git/blob/refs/heads/6.x-1.x:...
http://drupalcode.org/project/documentation.git/blob/refs/heads/6.x-1.x:...
Unless I'm misunderstanding the need?
Comment #11
jhodgdonCorrect, sorry I just assumed without actually checking. Thanks!
Comment #12
Albert Volkman CreditAttribution: Albert Volkman commentedNo prob at all!
Comment #13
Gábor HojtsySuperb, committed, pushed.