'Check if group has the permission for the given object'

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):
            return cached_perms.get((obj.pk, content_type_pk, perm, approved))
        return _group_has_perms(self._group_perm_cache)
    return Permission.objects.group_permissions(self.group, perm, obj, approved).filter(object_id=obj.pk).exists()
