22#ifdef HAVE_SERVER_PYTHON_PLUGINS
27#ifdef HAVE_SERVER_PYTHON_PLUGINS
30 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
35 if ( !originalLayerFilters.contains( layer ) )
37 originalLayerFilters.insert( layer, layer->subsetString() );
39 if ( !layer->subsetString().isEmpty() )
41 sql.prepend(
") AND (" );
43 sql.prepend( layer->subsetString() );
46 if ( !layer->setSubsetString( sql ) )
56 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
61 if ( !layer->subsetString().isEmpty() )
63 sql.prepend(
") AND (" );
65 sql.prepend( layer->subsetString() );
68 if ( !layer->setSubsetString( sql ) )
80 QHash<QgsMapLayer *, QString>::const_iterator filterIt = filterMap.constBegin();
81 for ( ; filterIt != filterMap.constEnd(); ++filterIt )
83 QgsVectorLayer *filteredLayer = qobject_cast<QgsVectorLayer *>( filterIt.key() );
A helper class that centralizes restrictions given by all the access control filter plugins.
QString extraSubsetString(const QgsVectorLayer *layer) const
Returns an additional subset string (typically SQL) filter.
Base class for all map layer types.
static void logMessage(const QString &message, const QString &tag=QString(), Qgis::MessageLevel level=Qgis::MessageLevel::Warning, bool notifyUser=true)
Adds a message to the log instance (and creates it if necessary).
static void applyAccessControlLayerFilters(const QgsAccessControl *accessControl, QgsMapLayer *mapLayer, QHash< QgsMapLayer *, QString > &originalLayerFilters)
Apply filter from AccessControl.
void restoreLayerFilters(const QHash< QgsMapLayer *, QString > &filterMap)
Apply filter from AccessControal.
Represents a vector layer which manages a vector based data sets.
virtual bool setSubsetString(const QString &subset)
Sets the string (typically sql) used to define a subset of the layer.