Index: taxonomy_access.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/taxonomy_access/taxonomy_access.module,v retrieving revision 1.107.2.19 diff -u -p -r1.107.2.19 taxonomy_access.module --- taxonomy_access.module 18 Mar 2010 21:38:51 -0000 1.107.2.19 +++ taxonomy_access.module 22 Jun 2010 00:05:24 -0000 @@ -367,6 +367,19 @@ function taxonomy_access_nodeapi(&$node, //INFO: node_access_write_grants($node, $grants, $realm = NULL, $delete = TRUE) node_access_write_grants($node, array(), 'term_access'); break; + case 'validate': + global $user; + if (is_array($arg['taxonomy'][1]['#value'])) $categories = $arg['taxonomy'][1]['#value']; + else $categories = array($arg['taxonomy'][1]['#value']); + foreach ($user->roles as $rid => $role_name) { + foreach(taxonomy_access_get_grants($rid) as $term_id => $value) { + if (in_array($term_id, $categories) && $value['update'] == 2 && $value['delete'] == 2) { + form_set_error('taxonomy[1]', t("You cannot use %tax, please select another section.", + array('%tax' => taxonomy_get_term($term_id)->name))); + } + } + } + break; } }