def has_site_permission(user):
    mw = "mezzanine.core.middleware.SitePermissionMiddleware"
    if mw not in settings.MIDDLEWARE_CLASSES:
        from warnings import warn
        warn(mw + " missing from settings.MIDDLEWARE_CLASSES - per site"
             "permissions not applied")
        return user.is_staff and user.is_active
    return getattr(user, "has_site_permission", False)
Serializing control characters with XML should fail as those characters
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/utils/sites.py/has_site_permission--crossover with--dataset/ETHPy150Open django/django/tests/serializers/test_xml.py/XmlSerializerTestCase.test_control_char_failure