Index: includes/content.node_form.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/includes/content.node_form.inc,v
retrieving revision 1.7.2.10
diff -u -r1.7.2.10 content.node_form.inc
--- includes/content.node_form.inc	7 Jul 2008 13:07:32 -0000	1.7.2.10
+++ includes/content.node_form.inc	23 Aug 2008 15:55:51 -0000
@@ -39,10 +39,29 @@
   $node = $form['#node'];
   $addition = array();
   $form_element = array();
+  $field_name = $field['field_name'];
+  
+  // See if access to this form element is restricted, 
+  // if so, skip widget processing and just set the value.
+  $access = TRUE;
+  $field_access = module_invoke_all('field_access', 'edit', $field);
+  foreach ($field_access as $value) {
+    if (empty($value)) {
+      $access = FALSE;
+    }
+  }
+  if (!$access) {
+    $addition[$field_name] = array(
+      '#access' => $access,
+      '#type' => 'value',
+      '#value' => $node->$field_name,
+      );
+    return $addition;
+  }
+  
   // TODO: is the "if (function_exists($function)) {" needed ?
   // defining the $function here makes it unclear where it is actually called
   $function = $field['widget']['module'] .'_widget';
-  $field_name = $field['field_name'];
   if (function_exists($function)) {
     // Prepare the values to be filled in the widget.
     // We look in the following places:
@@ -115,6 +134,7 @@
         '#field_name' => $field['field_name'],
         '#tree' => TRUE,
         '#weight' => $field['widget']['weight'],
+        '#access' => $access,
         // TODO: what's the need for #count ? does not seem to be used anywhere ?
         '#count' => count($form_element),
       );
Index: modules/content_permissions/content_permissions.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/cck/modules/content_permissions/content_permissions.module,v
retrieving revision 1.5
diff -u -r1.5 content_permissions.module
--- modules/content_permissions/content_permissions.module	11 May 2008 19:20:09 -0000	1.5
+++ modules/content_permissions/content_permissions.module	23 Aug 2008 15:55:27 -0000
@@ -13,20 +13,6 @@
 }
 
 /**
- *  Implementation of hook_form_alter(). Remove inaccessible fields from node display.
- */
-function content_permissions_form_alter(&$form, $form_state, $form_id) {
-  if (isset($form['type']) && isset($form['#node']) && $form['type']['#value'] .'_node_form' == $form_id) {
-    $type = content_types($form['type']['#value']);
-    foreach ($type['fields'] as $field_name => $field) {
-      if (isset($form[$field_name])) {
-        $form[$field_name]['#access'] = user_access('edit '. $field_name);
-      }
-    }
-  }
-}
-
-/**
  *  Implementation of hook_nodeapi(). Remove inaccessible fields from node display.
  */
 function content_permissions_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
@@ -41,6 +27,20 @@
 }
 
 /**
+ *  Remove inaccessible fields from nodes.
+ * 
+ * @see content_field_form(). 
+ */
+function content_permissions_field_access($op, $field) {
+  switch ($op) {
+    case 'view':
+    case 'edit':
+      return user_access($op .' '. $field['field_name']);
+  }
+  return TRUE;
+}
+
+/**
  *  The default field access callback. Remove inaccessible fields from Views.
  * 
  * @see content_views_field_views_data(). 

