Reputation: 2299
I'm creating a custom Drupal 7 module and within my module I'm creating a node programmatically. In summary, it's something like this:
$node = new stdClass();
$node->type = 'donation';
node_object_prepare($node);
$node->title = 'Donation made on ' . date('r');
node_save($node);
How can I modify/set the permission for this dynamically created node so it's only accessible to admins?
Upvotes: 2
Views: 1421