Index: modules/category/category.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/category/category.module,v
retrieving revision 1.100.2.20
diff -u -r1.100.2.20 category.module
--- modules/category/category.module	25 Sep 2006 13:35:46 -0000	1.100.2.20
+++ modules/category/category.module	5 Oct 2006 18:15:51 -0000
@@ -346,6 +346,20 @@
     '#description' => t('If set to more than zero, this allows your containers to select other containers, or categories, as distant parents. Changing this setting does not affect your existing containers; unless you change it from \'one\' or \'multiple\' to \'zero\', and you then manually update an individual container, in which case all distant parent relationships for that container will be lost. This setting does not affect distant parent relationships for categories: these are managed separately within each container.')
   );
 
+  // Tweaks
+  $form['tweaks'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Tweaks and optimizations'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );
+  $form['tweaks']['category_cid_full_acl_enabled'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Enable full ACL for categories'),
+    '#default_value' => variable_get('category_cid_full_acl_enabled',TRUE),
+    '#description' => t('For sites with a large number of categories, the access checks to check whether a category is available for use can take an unreasonable amount of time. Disabling this will let your site work efficiently with a very large number of categories, however, you lose the ability to hide categories from category selectors that the user does not have access to.'),
+  );
+
   // Allow other modules to add additional settings.
   $extra = module_invoke_all('category', 'settings');
   if (isset($extra) && is_array($extra)) {
@@ -1831,9 +1845,11 @@
     return FALSE;
   }
 
-  // Next, we get rid of categories that the user does not have access to
-  if (!node_access('view', node_load($category->cid))) {
-    return FALSE;
+  if(variable_get('category_cid_full_acl_enabled',TRUE)) {
+    // Next, we get rid of categories that the user does not have access to
+    if (!node_access('view', node_load($category->cid))) {
+      return FALSE;
+    }
   }
 
   // If no container has been specified, then all categories from all
