(self, perm, obj, approved)
return (
            Permission.objects.group_permissions(self.group, perm, obj, approved,)
            .filter(object_id=obj.pk,)
            .exists()
        )
Check if group has the permission for the given object
Check if group has the permission for the given object
Check if group has the permission for the given object
def has_group_perms(self, perm, obj, approved):
        """
        Check if group has the permission for the given object
        """
        if not self.group:
            return False

        if self.use_smart_cache:
            content_type_pk = Permission.objects.get_content_type(obj).pk

            def _group_has_perms(cached_perms):
                # Check to see if the permission is in the cache.
                return cached_perms.get((obj.pk, content_type_pk, perm, approved,))

            # Check to see if the permission is in the cache.
            return _group_has_perms(self._group_perm_cache)

        # Actually hit the DB, no smart cache used.
        return (
            Permission.objects.group_permissions(self.group, perm, obj, approved,)
            .filter(object_id=obj.pk,)
            .exists()
        )
def has_group_perms ( self , perm , obj , approved ) : if not self . group : return False if self . use_smart_cache : content_type_pk = Permission . objects . get_content_type ( obj ) . pk def _group_has_perms ( cached_perms ) : # Check to see if the permission is in the cache. return cached_perms . get ( ( obj . pk , content_type_pk , perm , approved , ) ) # Check to see if the permission is in the cache. return _group_has_perms ( self . _group_perm_cache ) # Actually hit the DB, no smart cache used. return ( Permission . objects . group_permissions ( self . group , perm , obj , approved , ) . filter ( object_id = obj . pk , ) . exists ( ) )