@cached(user=True)
    def sitemap(self, request):
        infos = []
        resources = []
        for child in self.routes:
            if isinstance(child, AdminModel):
                resource = child.model.name
                resources.append(resource)
                section, info = child.info(request)
                infos.append((resource, section, info))

        backend = request.cache.auth_backend
        sections = {}
        sitemap = []

        if backend:
            permissions = backend.get_permissions(request, resources, 'read')
            infos = self._permission_filter(permissions, infos)

        for resource, section, info in infos:
            if section not in sections:
                items = []
                sections[section] = {'name': section,
                                     'items': items}
                sitemap.append(sections[section])
            else:
                items = sections[section]['items']

            items.append(info)

        return sitemap
dataset/ETHPy150Open quantmind/lux/lux/extensions/admin/admin.py/Admin.sitemap/original