How do I hide buttons like the "delete" one in a node form? Consider I created a CCK node called assignment, and I am adding assignments with that.

There is a field called "published" with a check box. If the assignment is published, then it should not be deleted.

My problem is how I can hide the "delete" button if the assignment is published. By using prefix and suffix and using display: none; in hook_form_alter() will work, but it is not the secured way. I need something in the Drupal way.
You can use hook_access().
Super simple example will hide button "Delete" automaticaly and disallow deletion of some nodes in any other places in Drupal.  

Important note: 


  The administrative account (user ID #1) always passes any access check, so this hook is not called in that case. 


function MYMODULE_access($op, $node, $account) {
   if ($op == 'delete') {
      if ($node-&gt;something != 'something') {
          return FALSE;
      }
   }
}


For Drupal 7 there is hook_node_access() for this stuff.