// get permissions
$permissions = XenForo_Visitor::getInstance()->getPermissions();
// get viewDeleted permission
$viewDeleted = XenForo_Permission::hasPermission($permissions, "forum", "viewDeleted");
// if viewDeleted is false display no permission response
if (!$viewDeleted)
{
throw $this->getNoPermissionResponseException();
}