Index: project_issue.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/project_issue.module,v
retrieving revision 1.147
diff -u -p -r1.147 project_issue.module
--- project_issue.module	17 Mar 2009 07:44:57 -0000	1.147
+++ project_issue.module	17 Mar 2009 23:34:31 -0000
@@ -1793,3 +1793,29 @@ function project_issue_get_projects($con
   return $options;
 }
 
+/**
+ * Menu access callback for the project_issue_plugin_access_user_list plugin.
+ */
+function project_issue_views_user_access($view_name, $display_id, $argument_name) {
+  $view = views_get_view($view_name);
+  $view->set_display($display_id);
+  $view->init_handlers();
+  // Find the values for any arguments embedded in the path via '%'.
+  $i = 0;
+  foreach (explode('/', $view->display_handler->get_option('path')) as $element) {
+    if ($element == '%') {
+      $view->args[] = arg($i);
+    }
+    $i++;
+  }
+  // Now handle any implicit arguments from the end of the path.
+  $num_arguments = count($view->argument);
+  while (count($view->args) < $num_arguments) {
+    $view->args[] = arg($i);
+    $i++;
+  }
+
+  $arg_uid = $view->argument[$argument_name]->get_value();
+  return !empty($arg_uid);
+}
+
Index: views/project_issue.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/views/project_issue.views.inc,v
retrieving revision 1.7
diff -u -p -r1.7 project_issue.views.inc
--- views/project_issue.views.inc	16 Feb 2009 20:38:24 -0000	1.7
+++ views/project_issue.views.inc	17 Mar 2009 23:34:31 -0000
@@ -225,7 +225,7 @@ function project_issue_views_handlers() 
 }
 
 function project_issue_views_plugins() {
-  $path = drupal_get_path('module', 'project_issue');
+  $path = drupal_get_path('module', 'project_issue') . '/views/plugins';
   $views_path = drupal_get_path('module', 'views');
   return array(
     'style' => array(
@@ -234,7 +234,7 @@ function project_issue_views_plugins() {
         'help' => t('Table with colored rows depending on issue status.'),
         'handler' => 'project_issue_table_plugin_style',
         'parent' => 'table',
-        'path' => "$path/views/plugins",
+        'path' => $path,
         'theme' => 'views_view_table',
         'theme file' => 'theme.inc',
         'theme path' => "$views_path/views/theme",
@@ -244,5 +244,15 @@ function project_issue_views_plugins() {
         'type' => 'normal',
       ),
     ),
+    'access' => array(
+      'project_issue_access_per_user_queue' => array(
+        'title' => t('View per-user issue queues'),
+        'help' => t('Access will be granted if the user is requested in the URL or for users viewing their own per-user issue queues.'),
+        'handler' => 'project_issue_plugin_access_per_user_queue',
+        'uses options' => TRUE,
+        'path' => $path,
+      ),
+    ),
   );
 }
+
Index: views/project_issue.views_default.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/project_issue/views/project_issue.views_default.inc,v
retrieving revision 1.41
diff -u -p -r1.41 project_issue.views_default.inc
--- views/project_issue.views_default.inc	27 Feb 2009 06:56:20 -0000	1.41
+++ views/project_issue.views_default.inc	17 Mar 2009 23:34:33 -0000
@@ -1256,7 +1256,8 @@ function project_issue_views_default_vie
   }
   $handler->override_option('filters', $filters);
   $handler->override_option('access', array(
-    'type' => 'none',
+    'type' => 'project_issue_access_per_user_queue',
+    'project_issue_user_argument' => 'uid_touch',
   ));
   $handler->override_option('title', 'My issues');
   $handler->override_option('empty', 'No issues match your criteria.');
@@ -1715,7 +1716,8 @@ function project_issue_views_default_vie
   }
   $handler->override_option('filters', $filters);
   $handler->override_option('access', array(
-    'type' => 'none',
+    'type' => 'project_issue_access_per_user_queue',
+    'project_issue_user_argument' => 'uid',
   ));
   $handler->override_option('empty', 'No issues match your criteria.');
   $handler->override_option('empty_format', '1');
Index: views/plugins/project_issue_plugin_access_per_user_queue.inc
===================================================================
RCS file: views/plugins/project_issue_plugin_access_per_user_queue.inc
diff -N views/plugins/project_issue_plugin_access_per_user_queue.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ views/plugins/project_issue_plugin_access_per_user_queue.inc	17 Mar 2009 23:34:33 -0000
@@ -0,0 +1,52 @@
+<?php
+// $Id$
+
+/**
+ * Validate whether an argument is a real user and return 403 if not.
+ *
+ * We use this for per-user issue queues ("My projects" and "My issues") to
+ * return a 403 on cases where anonymous users visit the view without
+ * providing a username or UID in the URL.
+ */
+class project_issue_plugin_access_per_user_queue extends views_plugin_access {
+
+  /**
+   * Check access outside of the menu system (e.g. used for block displays).
+   */
+  function access($account) {
+    $this->view->set_display($this->display->id);
+    $this->view->init_handlers();
+    $user_arg = $this->options['project_issue_user_argument'];
+    $argument = $this->view->argument[$user_arg];
+    $arg_uid = $argument->get_value();
+    return !empty($arg_uid);
+  }
+
+  function get_access_callback() {
+    return array('project_issue_views_user_access', array($this->view->name, $this->display->id, $this->options['project_issue_user_argument']));
+  }
+
+  function summary_title() {
+    return t('Has a per-user issue queue');
+  }
+
+  function option_defaults(&$options) {
+    $options['project_issue_user_argument'] = '';
+  }
+  
+  function options_form(&$form, &$form_state) {
+    $arguments = array();
+    foreach ($this->view->display_handler->get_handlers('argument') as $id => $handler) {
+      $arguments[$id] = $handler->definition['title'];
+    }
+    $form['project_issue_user_argument'] = array(
+      '#type' => 'select',
+      '#options' => $arguments,
+      '#title' => t('Project issue user argument'),
+      '#description' => t('You must select which argument to this view represents the user the issues are associated with.'),
+      '#default_value' => $this->options['project_issue_user_argument'],
+    );
+  }
+
+}
+
