only read affected access restrictions if needed
@@ -81,12 +81,10 @@ def tile(request, level, zoom, x, y, access_permissions=None):
access_permissions = set()
else:
access_permissions = parse_tile_access_cookie(cookie, settings.SECRET_TILE_KEY)
+ access_permissions &= set(level_data.restrictions[minx:miny, maxx:maxy])
else:
access_permissions = set(int(i) for i in access_permissions.split('-')) - set([0])
- # only access permissions that are affecting this tile
- access_permissions &= set(level_data.restrictions[minx:miny, maxx:maxy])
-
# build cache keys
last_update = level_data.history.last_update(minx, miny, maxx, maxy)
base_cache_key = build_base_cache_key(last_update)
