In general, node access does not need to be updated when only create or list permissions change, because these permissions are applied by hook_db_rewrite_sql() and do not affect node access. It is particularly unnecessary to flag node access for rebuild in the case that someone changes only create or list for a global default.

CommentFileSizeAuthor
#2 tac_742072-2.patch4.57 KBxjm

Comments

xjm’s picture

This is applicable when the user clicks "Save All" on the admin form. In the case of adding or deleting rows on the admin form, node access should always be updated.

Currently, the submit handler checks each row against the initial form state, and if it differs, then the row data are passed on to taxonomy_access_defaults_update() or taxonomy_access_grant_update() as appropriate. These functions insert records into the appropriate taxonomy access table and then add nodes affected by that row to the list of nodes to be updated.

One option without any refactoring might be to add an additional, optional argument to the two update functions above, say a $skip_nodes flag:

function taxonomy_access_defaults_update($vid, $rid = NULL, $grants = NULL, $skip_nodes = FALSE) {

Then, the submit handler could set this flag if the view, update, and delete permissions are unchanged when the user clicks "save all", without affecting anything else.

xjm’s picture

Status: Active » Needs review
StatusFileSize
new4.57 KB

Attached patch implements the solution described in #1. Seems to work fine; the list of nodes updated is correct in each case.

xjm’s picture

Status: Needs review » Fixed

Committed to 6.x-1.x-dev:
http://drupal.org/cvs?commit=341668

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.