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 a918290 commit d7f7481e9c9e166e3fd540a069bc33a3da0e26b4
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/server/qgsserverprojectparser.cpp
@@ -1184,6 +1184,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 d7f7481

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