diff --git a/nodeaccess.module b/nodeaccess.module
index eacdfc7..4cc830d 100644
--- a/nodeaccess.module
+++ b/nodeaccess.module
@@ -31,6 +32,17 @@ function nodeaccess_menu() {
   );
   return $items;
 }
+/**
+ * Implementation of hook_menu_alter().
+ */
+function nodeaccess_menu_alter(&$items) {
+  $items['node/%node/edit']['access callback'] = 'nodeaccess_edit_access';
+  $items['node/%node/edit']['access arguments'] = array('update', 1);
+
+  $items['node/%node/delete']['access callback'] = 'nodeaccess_edit_access';
+  $items['node/%node/delete']['access arguments'] = array('delete', 1);
+}
+
 
 /**
  * Implementation of hook_perm().
@@ -40,11 +52,30 @@ function nodeaccess_perm() {
 }
 
 /**
+ * Prevent anonymous users from edit/delete access via node->uid = 0 flaw.
+ */
+function nodeaccess_edit_access($op, $node) {
+  global $user;
+  // If the node belongs to a deleted user.
+  if($user->uid == 0 && $node->uid == 0){
+    // We check if the role has specified update/delete access to this node.
+    $grants = _nodeaccess_get_grants($node);
+    if (($grants['rid'][1]['grant_update'] && $op == 'update') ||
+        ($grants['rid'][1]['grant_delete'] && $op == 'delete')) {
+      return TRUE;
+    }
+    // Otherwise, ignore the fact that anonymous is now faux-"author".
+    return FALSE;
+  }
+  // If check has passed, call the standard node_access for update/delete $op.
+  return node_access($op, $node);
+}
+
+/**
  * Implementation of hook_access().
  */
 function nodeaccess_access($op, $node, $account = NULL) {
   global $user;
-
   if (!$node) {
     return FALSE;
   }
