Drupal 6: Restrict which roles can modify node taxonomy

I recently decided to use taxonomy to set the status of my nodes as they moved through phases of the application. A created a category called status and added the terms: incomplete, complete, and submitted. I needed the ability to restrict who can set the taxonomy, so I wrote this module which allows you to set which roles can modify taxonomy:

<?phpfunctiontpr_perm(){returnarray('modify node taxonomy');}functiontpr_form_alter(&$form,$form_state,$form_id){// ensure this is a node formif(substr($form_id,-10)!='_node_form')return;// ensure taxonomy exists for this node typeif(!isset($form['taxonomy']))return;// if the user does not have permission to modify node taxonomy:if(!user_access('modify node taxonomy')){// node already existsif(isset($form['#node']->nid)){// loop through taxonomy form elementsforeach($form['taxonomy']as$k=>$v){// set each form element to disabledif(is_int($k)&&is_array($v)){$form['taxonomy'][$k]['#disabled']=true;}}}else{// new node, remove taxonomy from elements// loop through taxonomy from elementsforeach($form['taxonomy']as$k=>$v){if(is_int($k)&&is_array($v)){// get first termID$termID=array_shift(array_keys($v['#options'][0]->option));if(is_int($termID)){// set default option$form['taxonomy'][$k]['#default_value']=$termID;}// set element as disabled$form['taxonomy'][$k]['#disabled']=true;}}}}}?>