--- flag_friend_access.module	2009-06-09 21:24:29.000000000 +0200
+++ flag_friend_accessNew.module	2009-11-11 20:23:54.132406072 +0100
@@ -17,6 +17,9 @@ function flag_friend_access_node_grants(
     if (!empty($friends)) {
       $grants['flag_friend'] = array_keys($friends);
     }
+    
+    $grants['flag_friend_author'] = array($account->uid);
+
     return $grants;
   }
 }
@@ -26,16 +29,28 @@ function flag_friend_access_node_grants(
  */
 function flag_friend_access_node_access_records($node) {
   if ($node->flag_friend_access) {
-    return array(
-      array(
-        'realm' => 'flag_friend',
-        'gid' => $node->uid,
-        'grant_view' => 1,
-        'grant_update' => 0,
-        'grant_delete' => 0,
-        'priority' => 5,
-      ),
+
+    $grants = array();    
+
+    $grants[] = array(
+      'realm' => 'flag_friend',
+      'gid' => $node->uid,
+      'grant_view' => 1,
+      'grant_update' => 0,
+      'grant_delete' => 0,
+      'priority' => 0,
+    );
+
+    $grants[] = array(
+      'realm' => 'flag_friend_author',
+      'gid' => $node->uid,
+      'grant_view' => TRUE,
+      'grant_update' => TRUE,
+      'grant_delete' => TRUE,
+      'priority' => 0,
     );
+
+    return $grants;
   }
 }
 
@@ -56,4 +71,4 @@ function flag_friend_access_form_alter(&
       '#title' => t('Only My Friends'),
     );
   }
-}
\ No newline at end of file
+}
