I do this in Boost 7.x. It's not pretty, but it does get the job done.
hook_page_delivery_callback_alter
boost_page_delivery_callback_alter
boost_deliver_html_page() is on line 1181 of the above link (#l1181). I can't post more then 2 links due to spam prevention.
function boost_page_delivery_callback_alter(&$callback, $set = FALSE) {
if ($callback == 'drupal_deliver_html_page') {
$callback = 'boost_deliver_html_page';
}
}
function boost_deliver_html_page($page_callback_result) {
global $_boost;
// Menu status constants are integers; page content is a string or array.
if (is_int($page_callback_result)) {
// @todo: Break these up into separate functions?
switch ($page_callback_result) {
// …
case MENU_ACCESS_DENIED:
// 403 page.
$_boost['menu_item']['status'] = 403;
break;
// …
}
// …
}
// …
}