code: def _get_group_cached_perms(self):
          
          if not self.group:
              return {}
          perms = Permission.objects.filter(
              group=self.group,
          )
          group_permissions = {}
          for perm in perms:
              group_permissions[(
                  perm.object_id,
                  perm.content_type_id,
                  perm.codename,
                  perm.approved,
              )] = True
          return group_permissions
docs: Set group cache.