Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
content_permissions_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
contributions/cck/modules/content_permissions/content_permissions.module, line 17
Implementation of hook_nodeapi(). Remove inaccessible fields from node display.
<?php
function content_permissions_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if ($op == 'view') {
$type = content_types($node->type);
foreach ($type['fields'] as $field_name => $field) {
if (isset($node->content[$field_name])) {
$node->content[$field_name]['#access'] = user_access('view '. $field_name);
}
}
}
}
?>