Permissions defined by fields I have some content that has state field. I would like to permit users with the same state to delete this content.
Can  I implement this in Drupal?
Can I implement it with PHP code?
custom.info

PS. Do not include &lt;?php ?&gt; tags.



; $Id:
name = Custom
description = Custom validate node delete permission
package = Custom
core = 6.x


custom.module

  &lt;?php
    /*
     * file
     */
    function MYMODULE_form_alter(&amp;$form, &amp;$form_state&lt; $form_id){
      switch($form_id){
        case 'node_delete_confirm':
          $form['#validate'][] = 'my_custom_validate';
          break;
      }
    }

    function my_custom_validate($form, &amp;$form_state){
      $nid = $form_state['values']['nid'];
      $node = node_load($nid);
      if(/* conditions */) {
        // some procedure to check fields
        $message = t('You have not any permission to delete this node!');
        form_set_error('nid', $message);
      }
    }
  ?&gt;


Place this files into /sites/all/modules/custom/*.* and activate it on module administration page.
Enjoy.