? domain_content.patch
Index: domain_content.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_content/domain_content.module,v
retrieving revision 1.6
diff -p -0 -r1.6 domain_content.module
*** domain_content.module	10 Nov 2007 01:56:52 -0000	1.6
--- domain_content.module	10 Nov 2007 22:37:03 -0000
*************** function domain_content_form() {
*** 194 ****
--- 195,216 ----
+   
+   // Bypass the superuser permissions by forcing an AND on {node_access}.
+   $filter['join'] .= " INNER JOIN {node_access} na ON na.nid = n.nid ";
+   $arg = arg(3);
+   if ($arg != 'all') {
+     // In this case, we must check the domain_id grant.
+     if (empty($filter['where'])) {
+       $filter['where'] = " WHERE na.realm = 'domain_id' AND na.gid = ". $_domain['domain_id'] ." ";
+     }
+     else {
+       $filter['where'] .= " AND na.realm = 'domain_id' AND na.gid = ". $_domain['domain_id'] ." ";
+     }
+   }
+   else {
+     // Or check the domain_site grant.
+     if (empty($filter['where'])) {
+       $filter['where'] = " WHERE na.realm = 'domain_site' AND na.gid = 0 ";
+     }
+     else {
+       $filter['where'] .= " AND na.realm = 'domain_id' AND na.gid = 0 ";
+     }
+   }
