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

Mark mark at nullcraft.org
Fri Feb 11 18:56:59 UTC 2005


Hello Bèr,

I did respond to your clipper.module suggestion 
(http://drupal.org/node/16207#comment-27372).  It appeared to me that 
you were attaching nodes to taxonomy terms automatically.  Now that I'm 
looking at the code in more detail, it doesn't appear to be doing what 
it's supposed to.  When it creates new terms, it's not setting the 
parent correctly for some reason.  I'll submit an issue with more details.

Fundamentally, however, it works differently from the module that I've 
written.  Clipper attaches nodes to taxonomy terms, whereas Node 
Relativity attaches nodes to nodes.  The level of flexibility and 
configuration that I needed for my project goes beyond what the taxonomy 
system currently allows.  I needed a way to restrict parenting/childing 
based on node types and parental ordinality.  Putting this into taxonomy 
would be very difficult for me, and I'm not sure it would end up serving 
the purpose that I want (or that anybody else would want this in the 
taxonomy module).

I think that adapting clipper to my needs would mean abandoning it's use 
of taxonomy for storing the relations, which appears to be a fundamental 
feature of it.  It is a very useful module, but not one that fits my 
current needs.

Thanks,
Mark


Bèr Kessels wrote:

>Mark,
>
>two small things: 
>Did you look at my clipper.module. It does node relations already.
>It is a pity you did not post anything about node relations earlier, for i am 
>in need of extending or even rewriting clipper. module, to have more advanced 
>relations. But it might not be too late yet. :)
>
>Bèr
>
>Op vrijdag 11 februari 2005 03:10, schreef Mark:
>  
>
>>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.
>>
>>Thanks,
>>Mark Howell
>>(javanaut)
>>    
>>
>Bèr
>  
>




More information about the drupal-devel mailing list