This here uses a menu loader to verify that its a smackdown node and then passes the access check to the user_access callback.
This makes it so people can menu_alter() this cleanly. And it makes life simpler...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | smackdown_menu.patch | 1.59 KB | Scott Reynolds |
| #1 | smackdown_menu.patch | 1.42 KB | Scott Reynolds |
| smackdown_menu.patch | 1.45 KB | Scott Reynolds |
Comments
Comment #1
Scott Reynolds commenteddoh ! wrong version of the patch. tab root isn't needed here. though its an interesting and important and undocumented part of hook_menu() the menu system will figure out the right root.
Comment #2
Scott Reynolds commentedI still spoke to soon. Instead we can use node_access('view', $node); And this totally works because the object handed to node_access() is a 'node'. Slick...
Comment #3
Scott Reynolds commented... I failed to motivate this patch completly.
The reason to use a load function over an access function is really simple. If a user types in node/123/voting-results and 123 is not a smackdown node, what is the header you want sent. Access Denied or Page Not Found.
The load function will get you Page Not Found, which is what we want here.
Comment #4
sirkitree commentedcommitted http://drupal.org/cvs?commit=278840