def get_team_permissions(self, user_obj, obj=None):
        if user_obj.is_anonymous() or obj is not None:
            return set()
        if not hasattr(user_obj, "_team_perm_cache"):
            memberships = Team.objects.filter(
                Q(memberships__user=user_obj),
                Q(memberships__state="manager") | Q(memberships__state="member"),
            )
            perms = memberships.values_list(
                "permissions__content_type__app_label",
                "permissions__codename"
            ).order_by()
            user_obj._team_perm_cache = set(["%s.%s" % (ct, name) for ct, name in perms])
        return user_obj._team_perm_cache
Load object(s) from an input stream (or filename).
dataset/ETHPy150Open pinax/symposion/symposion/teams/backends.py/TeamPermissionsBackend.get_team_permissions--crossover with--dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/eggloader.py/load