Thread:Project:Support desk/How to modify API result with APIQueryAfterExecute hook?/reply (5)

Subclass whatever module you want, override the execute method, do your extra permissions checks, and then call parent::execute if it can carry on

Register it in the autoloader (use a different name) and change the target module in $wgAPIModules, $wgAPIMetaModules, $wgAPIPropModules, $wgAPIListModules to point at your new class name

Seems easy enough to me

Then in LocalSettings.php

Job done, no core hacks (only into LocalSettings.php), and doesn't mean you need to start arbitarily changing input