The feature can be toggled individually for groups - in layer tree view context menu.
This code has been funded by Tuscany Region (Italy) - SITA (CIG: 63526840AE) and commissioned to Gis3W s.a.s.
Feature funded by Tecnostudi Ambiente, Faunalia and Andromede-oceanologie.
The legend in composition was fixed and did not represent the layers in the map.
With the work made by @wonder-sk on layer-tree and QgsComposerLegend users will be able
to configure composer legend as based on all the project layer tree with auto-update
model or filtered by map.
This commit reused these two QgsComposerLegend's properties to filter it based on map in
GetPrint Request
The issue #4003 qgis_mapserver getPrint legend options can be closed.