Functions to alter node permissions can be found as part of the WTNode API here
// Making a node readable by all:
$node = $GLOBALS["WT"]->getNode($guid);
if($node) {
$node->setPermissions("__all", "read");
}
// Allowing a group write access to a node:
$node = $GLOBALS["WT"]->getNode($guid);
if($node) {
$node->setPermissions($groupID, "write");
}