diff --git a/drupalorg/drupalorg.views_default.inc b/drupalorg/drupalorg.views_default.inc index 6edf7d8..fca7b69 100644 --- a/drupalorg/drupalorg.views_default.inc +++ b/drupalorg/drupalorg.views_default.inc @@ -81,6 +81,28 @@ function _drupalorg_views_default_views_alter(&$views) { } } + // Both of the "all projects" views are currently very expensive to run + // and can easily take the db servers down if a crawler attempts to crawl + // them. + // Therefore, do not make them available to anonymous users. + // This does not affect the normal "single project" searches. + $auth_only_views = array( + 'project_issue_all_projects', + 'project_issue_search_all', + ); + $access = array( + 'type' => 'role', + 'role' => array( + '2' => 2, + ), + ); + foreach ($auth_only_views as $name) { + if (isset($views[$name])) { + $views[$name]->set_display('default'); + $views[$name]->display_handler->override_option('access', $access); + } + } + // Add block caching to the 'Recent issues' block for each project. $name = 'project_issue_project'; if (isset($views[$name])) {