[drupal-devel] [feature] Add create_child grant type in node_access system

clydefrog drupal-devel at drupal.org
Wed Apr 20 03:52:37 UTC 2005


Issue status update for http://drupal.org/node/20890

 Project:      Drupal
 Version:      cvs
 Component:    node system
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  clydefrog
 Updated by:   clydefrog
 Status:       patch
 Attachment:   http://drupal.org/files/issues/access_child_page.patch (3.26 KB)

This patch makes it possible to restrict which nodes can be used as
parents when editing child book pages. Here's a quick summary of the
changes:



Add grant_create_child column to node_access page.
Set grant_create_child to 1 in the default nid = 0 row.
Pass array('op' => 'create_child') to db_rewrite_sql() in book_toc().
Modify node_db_rewrite_sql() so that the "$op" argument is used in
_node_access_where_sql()
Generalize node_access_view_all_nodes() to node_access_all_nodes($op)

I'm not sure I've covered all the bases. In particular, the "add child
page" link still appears on all book pages. Also, there is nothing
stopping a clueful user from passing an arbitrary parent nid when
submitting. But shouldn't those be the responsibility of the particular
node_access module?


Thanks for considering this patch.


An aside: The attached patch was made with "diff -ru". Is it acceptable
to use "cvs diff -u" as well?




clydefrog




More information about the drupal-devel mailing list