joomla/joomla-platform — pull request #1305 by ShMaunder (2012-06-22 18:33:33+00:00)
Title: Import plugins on authorise instead of loading

*Apologies if this has been done incorrectly - this is my first ever pull request.

I think the authorise method is suppose to importPlugin() - I can't see any point in using getPlugin() as this will return plug-in data (which isn't captured anyway) and doesn't import them for the dispatcher.

Also, when calling the authorise method, you have to import both plug-in groups manually which seems pointless:
JPluginHelper::importPlugin('user');
JPluginHelper::importPlugin('authentication');
$authorisations = JAuthentication::authorise($response, $options);