[drupal-devel] Working around node_access in node/add

Mark mark at nullcraft.org
Fri Feb 11 02:11:48 UTC 2005

Hello drupal-devel,

Lately, I've been working on the Node Relativity module, and I've come 
up against some issues that I'm having trouble overcoming.  The main 
thing this module does is allow parent/child relationships to exist 
between nodes.  One of the features of this module is the ability to 
require that a given type of node not exist unless it is a child of an 
appropriate parent node.  This works all well and good from within the 
module (except for the occasional bug), but when a user goes to the 
"create content" page (node/add), they see listed before them every type 
of node that they have permission to create.  I want to limit this view 
and the menu associated with it. 

This brings me to my question: How do I override what is displayed on 
the node/add page or override the node_access permissions in general for 
node types not defined by my module?  I know that node.module checks 
node_list() and calls node_access('create',$node) on each of the node 
types to see if the current user has rights to create it.  I suspect 
that there's some way that I haven't seen yet that the node is mapped 
back to the module that defines it.  I would like to restrict this view 
even further such that users can create these nodes, but only under the 
appropriate circumstances.

Any ideas would be greatly appreciated.

Mark Howell

More information about the drupal-devel mailing list