Change viewers/editors programatically (node_save)
Ghostthinker - February 2, 2009 - 14:47
| Project: | Coherent Access |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Hallo,
For my project, I have the following setup:
- a content type party (and coherent access as enabled, default is not private)
- a cck userreference party host.
I build a batch import form with some values that automatically create the title. In my submit function a use emtpy $node object to store all the needed values like $node->title, etc. and then save it with node_save($node);
WORKS
But how do I set the coherent_access viewers? I tried:
$node->coherent_access['private'] = 1;
$node->coherent_access['viewers'][23] = "userx";But the values are not saved after node_save.
Any hints?

#1