Extension:AccessControl (https://github.com/wikimedia/mediawiki-extensions-AccessControl/tree/REL1_34) should probably not let rebuildFileCache.php cache pages that are supposed to be access restricted. I see Manual:Hooks/IsFileCacheable can be used.
Unfortunatey there are no examples of this hook Category:IsFileCacheable extensions, is this correct in AccessControl.hooks.php:
<?php
use MediaWiki\MediaWikiServices;
class AccessControlHooks {
public static function isFileCacheable (&$article) {
$matches = [];
$text = $article->getParserOutput(
// 0 gets the current ID
0, // $article->mOldId,
// Don't have a user (and hopefully shouldn't need one as just grabbing tags)
null
)->getRawText();
$parser = MediaWikiServices::getInstance()->getParser();
$parser->extractTagsAndParams(['accesscontrol'], $text, $matches);
return !count($matches);
}
...
}