content_permissions.module in Content Construction Kit (CCK) 6.3
File
modules/content_permissions/content_permissions.module
View source
<?php
function content_permissions_perm() {
$perms = array();
foreach (content_fields() as $field) {
$perms[] = 'edit ' . $field['field_name'];
$perms[] = 'view ' . $field['field_name'];
}
return $perms;
}
function content_permissions_field_access($op, $field, $account, $node = NULL) {
switch ($op) {
case 'view':
case 'edit':
return user_access($op . ' ' . $field['field_name'], $account);
}
return TRUE;
}