How to delete a Grant by GID
It would appear to me that Drupal 7 has no built in way to delete grants by GID, only by $node. Because of this I'm advocating doing a simple database query very similar to the query in node_access_write_grants().

Original:

 if ($delete) {
    $query = db_delete('node_access')
             -&gt;condition('nid', $node-&gt;nid);
    if ($realm) {
      $query-&gt;condition('realm', array($realm, 'all'), 'IN');
    }
    $query-&gt;execute();
 }


My code:

$query = db_delete('node_access')
         -&gt;condition('gid', $address-&gt;aid);
$query-&gt;execute();


Perhaps there's something to be said for using the 'realm' field to circumvent this issue.  However, this seems to work.  I'd love to know what the community thinks.