Skip to content
Permalink
Browse files

Fix the Access control in the WMS groups

  • Loading branch information
sbrunner committed Aug 8, 2018
1 parent 5e1184a commit cbf556915d06a8283cd13ad7197b5223bb2032b7
Showing with 232 additions and 16 deletions.
  1. +18 −16 src/server/services/wms/qgswmsrenderer.cpp
  2. +214 −0 tests/src/python/test_qgsserver_accesscontrol.py
@@ -330,18 +330,16 @@ namespace QgsWms
bool updateMapExtent = mWmsParameters.bbox().isEmpty();
Q_FOREACH ( QgsMapLayer *layer, layers )
{
checkLayerReadPermissions( layer );

Q_FOREACH ( QgsWmsParametersLayer param, params )
{
if ( param.mNickname == layerNickname( *layer ) )
{
checkLayerReadPermissions( layer );

setLayerOpacity( layer, param.mOpacity );

setLayerFilter( layer, param.mFilter );

setLayerAccessControlFilter( layer );

setLayerSelection( layer, param.mSelection );

if ( updateMapExtent )
@@ -350,6 +348,8 @@ namespace QgsWms
break;
}
}

setLayerAccessControlFilter( layer );
}

// add highlight layers above others
@@ -679,18 +679,16 @@ namespace QgsWms
bool updateMapExtent = mWmsParameters.bbox().isEmpty();
Q_FOREACH ( QgsMapLayer *layer, layers )
{
checkLayerReadPermissions( layer );

Q_FOREACH ( QgsWmsParametersLayer param, params )
{
if ( param.mNickname == layerNickname( *layer ) )
{
checkLayerReadPermissions( layer );

setLayerOpacity( layer, param.mOpacity );

setLayerFilter( layer, param.mFilter );

setLayerAccessControlFilter( layer );

setLayerSelection( layer, param.mSelection );

if ( updateMapExtent )
@@ -699,6 +697,8 @@ namespace QgsWms
break;
}
}

setLayerAccessControlFilter( layer );
}

// add highlight layers above others
@@ -781,21 +781,23 @@ namespace QgsWms
continue;
if ( !wfsLayerIds.contains( layer->id() ) )
continue;

checkLayerReadPermissions( layer );

Q_FOREACH ( QgsWmsParametersLayer param, params )
{
if ( param.mNickname == layerNickname( *layer ) )
{
checkLayerReadPermissions( layer );

setLayerOpacity( layer, param.mOpacity );

setLayerFilter( layer, param.mFilter );

setLayerAccessControlFilter( layer );

break;
}
}

setLayerAccessControlFilter( layer );

// cast for dxf layers
QgsVectorLayer *vlayer = static_cast<QgsVectorLayer *>( layer );

@@ -951,19 +953,19 @@ namespace QgsWms

Q_FOREACH ( QgsMapLayer *layer, layers )
{
checkLayerReadPermissions( layer );

Q_FOREACH ( QgsWmsParametersLayer param, params )
{
if ( param.mNickname == layerNickname( *layer ) )
{
checkLayerReadPermissions( layer );

setLayerFilter( layer, param.mFilter );

setLayerAccessControlFilter( layer );

break;
}
}

setLayerAccessControlFilter( layer );
}

// add layers to map settings (revert order for the rendering)

0 comments on commit cbf5569

Please sign in to comment.
You can’t perform that action at this time.