--- ../webform/includes/webform.pages.inc	2011-02-25 22:25:45.000000000 +0100
+++ webform.pagesNew.inc	2011-03-03 12:22:06.127534790 +0100
@@ -1,4 +1,5 @@
 <?php
+// $Id: webform.pages.inc,v 1.10.2.6 2011/02/07 03:51:19 quicksketch Exp $
 
 /**
  * @file
@@ -122,6 +123,7 @@ function webform_configure_form(&$form_s
   );
   /* End Edit Form */
 
+
   /* Start per-role submission control */
   $form['role_control'] = array(
     '#type' => 'fieldset',
@@ -147,6 +149,35 @@ function webform_configure_form(&$form_s
     '#description' => t('The %authenticated role applies to any user signed into the site, regardless of other assigned roles.', array('%authenticated' => $user_roles[2])),
   );
   /* End per-role submission control */
+  
+  
+ /* Start per-role submissions access control */
+  $form['role_access_control'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Result Submissions role access'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+    '#weight' => -3,
+    '#description' => t('These permissions affect which roles can view submissions in this webform.Remember if role have permission to show all submissions this not affected.'),
+    '#access' => variable_get('webform_submission_access_control', 1),
+  );
+  $user_access_roles = user_roles();
+  foreach ($user_access_roles as $rid => $rname) {
+    if ($rid == DRUPAL_ANONYMOUS_RID || $rid == DRUPAL_AUTHENTICATED_RID) {
+      continue;
+    }
+    $user_access_roles[$rid] = webform_tt("user:rid:$rid:name", $rname);
+  }
+  $form['role_access_control']['submissions_roles'] = array(
+    '#default_value' => $node->webform['submissions_roles'],
+    '#options' => $user_access_roles,
+    '#type' => 'checkboxes',
+    '#title' => t('Roles that can submit this webform'),
+    '#description' => t('The %authenticated role applies to any user signed into the site, regardless of other assigned roles.', array('%authenticated' => $user_roles[2])),
+  );
+  /* End per-role submission access control */

 
   /* Start advanced settings form */
   $form['advanced'] = array(
@@ -258,7 +289,14 @@ function webform_configure_form_submit($
 
   // Save roles.
   $node->webform['roles'] = array_keys(array_filter($form_state['values']['roles']));
-

+  // Save roles access submissions.
+  
+	$node->webform['submissions_roles'] = array_keys(array_filter($form_state['values']['submissions_roles']));
+  

  
   // Set the block option.
   $node->webform['block'] = $form_state['values']['block'];
 
