INNER CODE UNIT · Python

test_func

Patrowl/PatrowlManager · common/utils/__init__.py:11

    def test_func(user):
        from django.conf import settings
        if not settings.PRO_EDITION or user.is_superuser:
            return True
        for perm in args:
            if user.has_perm(perm):
                return True
        return False
    return user_passes_test(test_func)


def pro_group_required(*group_names):
    """Require user membership in at least one of the groups passed in."""
    def in_groups(u):
        from django.conf import settings
        if not settings.PRO_EDITION or u.is_superuser:
            return True
        if u.is_authenticated:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…