If we want that only show in the comments the changes y driven comments of cck according to user's permissio, I change comment_driven.module file :
In fucntion comment_driven_preprocess_comment(&$vars) near line 389 :
function comment_driven_preprocess_comment(&$vars) {
$comment = $vars['comment'];
$node_type = node_get_types('type', node_load($comment->nid))->type;
$log = comment_driven_load_log($comment->cid);
if (!$log) return;
// Description : Revision of 11/03/2011 hide comment for the CCK field
// according to user's permissions.
/****************/
/* BEGIN CHANGE */
/****************/
$key_diff_render=0;
foreach ($log->changes as $key_changes => $value){
$field = explode(":",$key_changes);
$type_field = $field[0];
$name_field = $field[1];
if(!user_access('view '.$name_field) && $type_field == 'cck')
{
unset($log->changes[$key_changes]);
unset($log->diff_render[$key_diff_render]);
}
$key_diff_render++;
}
/****************/
/* END CHANGE */
/****************/
$live_render = (!$log->frozen && comment_driven_is_live_render($node_type));
Comments
Comment #1
musa.thomasSorry for code color :
Comment #2
arhak commentedmmm... never addresses content_permission..
this looks good
the $key_diff_render looks hacky, diff_render should be keyed instead (which would need to review if any other code breaks, but I think it would bring no problem)