Security and rights

Layer rights

For each layer, both requests first check that it is not excluded from the WMS publication of the project, then query the access control of QGIS Server (accessControls().layerReadPermission()), which combines all the registered access control filters, e.g. the one of the lizmap_server plugin.

  • GetElevationLayers leaves out the layers the user may not read.

  • GetElevationProfile answers 403 for such a layer.

  • Without any access control filter (plugin used without Lizmap), nothing is restricted apart from the layers excluded from the WMS.

  • If the check itself fails, the layer is refused and the error is logged.

QGIS Server must stay private

With Lizmap, lizmap_server identifies the user with the X-Lizmap-User and X-Lizmap-User-Groups headers, added only by the Lizmap proxy. A request sent directly to QGIS Server has no such headers: lizmap_server then applies the default rights, and every layer is readable.

That is why Lizmap requires the QGIS Server URL to stay private, reachable only from Lizmap (see the Lizmap documentation, Pre-requirements). The profile requests must go through Lizmap (see With Lizmap).

Public server

On a QGIS Server reachable from the Internet:

  • only publish projects whose elevation layers may all be read by everyone, or exclude the others from the WMS publication;

  • limit ELEVATIONPROFILE_MAX_SAMPLES;

  • disable Copernicus if you do not want the server to download data on demand (ELEVATIONPROFILE_COPERNICUS=0).