GET /mapfiles: Get all mapfiles owned by the current user

def index(self):
        """ GET /mapfiles: Get all mapfiles owned by the current user """
        maps = self._get_maps_from_user(c.user)
        serialized_maps = []
        for m in maps:
            serialized_maps.append({
                "id": m.id,
                "name": m.name,
                "href": h.url_for(controller="mapfiles", action="show", id=m.id),
                'wmsproxyurl':h.url_for(controller='mapfiles', action='wms_proxy', id=m.id),
                'wmsurl': "%s?%s" %(config['mapserver_url'], urlencode({'map':os.path.join(config['mapfiles_dir'], m.filepath)}))
            })
        # prevent JSON Array Cross-site Exploits (XSRF/CSRF)
        return {'maps': serialized_maps}