Index: simplenews.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.admin.inc,v
retrieving revision 1.44
diff -u -p -r1.44 simplenews.admin.inc
--- simplenews.admin.inc	11 Dec 2008 08:42:18 -0000	1.44
+++ simplenews.admin.inc	20 Dec 2008 17:11:07 -0000
@@ -899,6 +899,15 @@ function simplenews_admin_settings_mail(
     '#description' => t('Sets the numbers of newsletters sent per cron run. Failure to send will also be counted.') .'<br />'.
       t('Cron execution must not exceed the PHP maximum execution time of %max seconds. You find the time spend to send emails in the <a href="/admin/reports/dblog">Recent log entries</a>.', array('%max' => ini_get('max_execution_time'))),
   );
+  $cron_user = array('default' => t('Default user'), 'author' => t('Newsletter author'));
+  $form['simplenews_mail_backend']['simplenews_cron_user'] = array(
+    '#type' => 'select',
+    '#title' => t('Cron user'),
+    '#options' => $cron_user,
+    '#default_value' => variable_get('simplenews_cron_user', 'default'),
+    '#description' => t("The user who's permission is used to send the newsletters. The content of the newsletter is determined by the permission of the selected user.") .'<br />'.
+    t('The <em>default</em> user is anonymous when sent by cron and the current user (the one who saved the node) when not using cron. Use <em>node author</em> only when the newsletter is (party) not accessible to anonymous user.'),
+  );
   $form['simplenews_mail_backend']['simplenews_spool_expire'] = array(
     '#type' => 'select',
     '#title' => t('Mail spool expiration'),
Index: simplenews.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/simplenews/simplenews.module,v
retrieving revision 1.176
diff -u -p -r1.176 simplenews.module
--- simplenews.module	20 Dec 2008 17:03:36 -0000	1.176
+++ simplenews.module	20 Dec 2008 17:11:11 -0000
@@ -1396,9 +1396,11 @@ function simplenews_send_node($node, $ac
       }
     }
 
-    // When cron is not used (simplenews_use_cron = FALSE) the spool content
-    // is send immediately after filling the spool. When cron is used spooled
-    // emails are send on each cron run.
+    // To send the newsletter, the node id and target email addresses
+    // are stored in the spool.
+    // When cron is not used the newsletter is send immediately to the emails
+    // in the spool. When cron is used newsletters are send to addresses in the 
+    // spool during the next (and following) cron run.
     foreach ($mails as $mail) {
       $data = array_merge($node_data, $mail);
       simplenews_save_spool($data);
@@ -1654,6 +1656,11 @@ function simplenews_mail_mail($nid, $vid
   $account->mail = $mail;
   $subscription = simplenews_get_subscription($account);
   $params['context']['account'] = $subscription;
+  if (variable_get('simplenews_cron_user', 'default') != 'default') {
+    // We send the newsletter the using permissions of an other user.
+    // Store the current user to be able to switch back later.
+    simplenews_switch_user();
+  }
 
   // Get node data for the mail
   $node = node_load(array('nid' => $nid, 'vid' => $vid));
@@ -1661,6 +1668,11 @@ function simplenews_mail_mail($nid, $vid
     $params['from'] = _simplenews_set_from($node);
     $params['context']['node'] = $node;
 
+    if (variable_get('simplenews_cron_user', 'default') != 'default') {
+      // Switch user to the node author to use the correct permissions.
+      // After building the newsletter we switch back to the original user.
+      simplenews_switch_user($node->nid, $node->vid);
+    }
     // Send mail
     if (module_exists('mimemail')) {
       // If mimemail module is installed ALL emails are send via this module.
@@ -1683,6 +1695,11 @@ function simplenews_mail_mail($nid, $vid
       $message = drupal_mail('simplenews', 'node', $subscription->mail, $subscription->language, $params, $params['from']['address'], TRUE);
     }
 
+    if (variable_get('simplenews_cron_user', 'default') != 'default') {
+      // Switch back to the original user.
+      simplenews_switch_user();
+    }
+
     // Log sent message.
     if (variable_get('simplenews_debug', FALSE)) {
       if (module_exists('mimemail')) {
@@ -2182,6 +2199,38 @@ function simplenews_help($path, $arg) {
 }
 
 /**
+ * Switch from original user to mail submision user and back.
+ *
+ * Note: taken from mailhandler.module.
+ *
+ * Note: You first need to run simplenews_switch_user without
+ * argument to store the current user. Call simplenews_switch_user
+ * without argument to set the user back to the original user.
+ *
+ * @param $uid The user ID to switch to
+ *
+ */
+function simplenews_switch_user($uid = NULL) {
+  global $user;
+  static $orig_user = array();
+
+  if (isset($uid)) {
+    session_save_session(FALSE);
+    $user = user_load(array('uid' => $uid));
+  }
+  // retrieve the initial user, can be called multiple times
+  else if (count($orig_user)) {
+    $user = array_shift($orig_user);
+    session_save_session(TRUE);
+    array_unshift($orig_user, $user);
+  }
+  // store the initial user
+  else {
+    $orig_user[] = $user;
+  }
+}
+
+/**
  * Flatten a nested array
  */
 function _simplenews_flatten_array($array) {
