def default_permission_factory(query_name, params):
from invenio_stats import current_stats<EOL>if current_stats.queries[query_name].permission_factory is None:<EOL><INDENT>return AllowAllPermission<EOL><DEDENT>else:<EOL><INDENT>return current_stats.queries[query_name].permission_factory(<EOL>query_name, params<EOL>)<EOL><DEDENT>
Default permission factory.

    It enables by default the statistics if they don't have a dedicated
    permission factory.