Make the User::hasPagePermission() and User::hasTemplatePermission() methods hookable per @niklaka issue #328