function content_permissions_nodeapi in Content Construction Kit (CCK) 6
Implementation of hook_nodeapi(). Remove inaccessible fields from node display.
File
- modules/
content_permissions/ content_permissions.module, line 30
Code
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);
}
}
}
}