Index: contrib/node_gallery_access/node_gallery_access.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery/contrib/node_gallery_access/node_gallery_access.module,v
retrieving revision 1.6.2.15
diff -u -r1.6.2.15 node_gallery_access.module
--- contrib/node_gallery_access/node_gallery_access.module	20 Nov 2009 00:22:44 -0000	1.6.2.15
+++ contrib/node_gallery_access/node_gallery_access.module	7 Dec 2009 20:24:49 -0000
@@ -150,9 +150,17 @@
   }
 }
 
-function node_gallery_access_check($node, $type = 'image') {
+function node_gallery_access_check_access($node, $type = NULL) {
   global $user;
   
+  if ($type == NULL) {
+	  if (in_array($node->type, (array)node_gallery_get_types('gallery'))) {
+	    $type = 'gallery';
+	  }
+	  else {
+	    $type = 'image';
+	  }
+  }
   if ($type == 'image') {
     $gallery_node = node_load($node->gid);
   }
@@ -262,7 +270,8 @@
           //can't rely on the nodeapi's $op value, need to check it out here.
           if ($old_access = node_gallery_access_exists($node->nid)) {
             drupal_write_record('node_gallery_access', $access, array('nid'));
-            if ($access->access_type != $old_access->access_type) {
+	          //When updating a gallery, we need to update the access records for the child images too.
+            if ($access->access_type != $old_access->access_type || in_array($node->type, (array)node_gallery_get_types('gallery'))) {
               node_gallery_access_rebuild($node);
             }
           }
@@ -305,7 +314,7 @@
     if (!$user->uid && variable_get('cache', 0)) {
       $GLOBALS['conf']['cache'] = FALSE;
     }
-    if ($user->uid != $node->uid && !node_gallery_access_perms_allow_access()) {
+    if ($user->uid != $node->uid && !node_gallery_access_check_access($node)) {
       $id = (!empty($gid) && is_numeric($gid)) ? $gid : $node->nid;
       // If node is password protected and not teaser nor page view and not owner of node
       if (!isset($_SESSION['_node_gallery']['passwords'][$id])) {
@@ -380,32 +389,6 @@
         'priority' => $priority,
       );
   }
-  if ($access_type == NODE_GALLERY_ACCESS_TYPE_PASSWORD) {
-      $grants[] = array(
-        'realm' => 'ng_access_author',
-        'gid' => $owner,
-        'grant_view' => TRUE,
-        'grant_update' => TRUE,
-        'grant_delete' => TRUE,
-        'priority' => $priority,
-      );
-      $grants[] = array(
-        'realm' => 'ng_access_password_view',
-        'gid' => 1,
-        'grant_view' => TRUE,
-        'grant_update' => FALSE,
-        'grant_delete' => FALSE,
-        'priority' => $priority,
-      );
-      $grants[] = array(
-        'realm' => 'ng_access_password_admin',
-        'gid' => 1,
-        'grant_view' => TRUE,
-        'grant_update' => TRUE,
-        'grant_delete' => TRUE,
-        'priority' => $priority,
-      );
-  }
   return $grants;
 }
 
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery/CHANGELOG.txt,v
retrieving revision 1.23.4.29
diff -u -r1.23.4.29 CHANGELOG.txt
--- CHANGELOG.txt	20 Nov 2009 04:35:30 -0000	1.23.4.29
+++ CHANGELOG.txt	7 Dec 2009 20:24:48 -0000
@@ -1,6 +1,8 @@
 $Id: CHANGELOG.txt,v 1.23.4.29 2009/11/20 04:35:30 kmonty Exp $
 
 node_gallery-6.x-2.0-dev
+#650022: default cover for galleries password protected not show
+#645650: Node Gallery Access Password Protection isnt' working
 #637958 by justintime: Node Gallery effectively setting author of node == author
 of the file on the filesystem representing the image
 #636104 by DesignWork: PHP Warning on 'Manage Images' page with an empty Gallery
