Skip to content
Permalink
Browse files

[BUGFIX][Server] Add short names in restricted layer list

The restricted layer list contains layer names and layer ids if layer ids are used as service layer name.
This code adds layer  short name to the restricted layer list if layer ids are not used as service layer name.
  • Loading branch information
rldhont committed Jan 12, 2017
1 parent a13ef7b commit b823874f8e2b5d15e5f2e0bedc2e267b4c46987c
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/server/qgsserverprojectparser.cpp
@@ -1189,6 +1189,27 @@ QSet<QString> QgsServerProjectParser::findRestrictedLayers() const
}
}
}
// Add short name in restricted layers
else
{
QDomNodeList layerNodeList = mXMLDoc->elementsByTagName( "maplayer" );
for ( int i = 0; i < layerNodeList.size(); ++i )
{
QDomElement layerElem = layerNodeList.at( i ).toElement();
// get name
QString lName = layerName( layerElem );
if ( restrictedLayerSet.contains( lName ) )
{
// get short name
lName = layerShortName( layerElem );
if ( !lName.isEmpty() )
{
// add short name
restrictedLayerSet.insert( lName );
}
}
}
}
return restrictedLayerSet;
}

0 comments on commit b823874

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