How to override content field data on view

Narcomancer Thu, 08/27/2009 - 22:50

Dzheki paliidziet, man pat drupal.org neviens neatbild :(

Hello!
I`m working on special permissions module inspired from uc_sell_cck module. The problem is that _nodeapi hook is not working for me as expected. My goal is to change readonly content field when user is viewing some node. <!--break--> As in uc_sell_cck I`m trying in this way:
<code>
function advanced_content_field_access_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
$node->content['field_some_name']['#field_name'] = 'new name';
}
</code>

But as I see form documenation and real work the _nodeapi() can only add new fields to form. After hook Drupal is overwriting my changes. The same recommendation is on this site http://www.ubercart.org/forum/development/848/hide_price_unless_logged but as I said it doesn`t work.
How to do that in right way?