22 #ifdef HAVE_SERVER_PYTHON_PLUGINS
27 #ifdef HAVE_SERVER_PYTHON_PLUGINS
29 QHash<QgsMapLayer *, QString> &originalLayerFilters )
31 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
36 if ( !originalLayerFilters.contains( layer ) )
38 originalLayerFilters.insert( layer, layer->subsetString() );
40 if ( !layer->subsetString().isEmpty() )
42 sql.prepend(
") AND (" );
44 sql.prepend( layer->subsetString() );
47 if ( !layer->setSubsetString( sql ) )
57 if (
QgsVectorLayer *layer = qobject_cast<QgsVectorLayer *>( mapLayer ) )
62 if ( !layer->subsetString().isEmpty() )
64 sql.prepend(
") AND (" );
66 sql.prepend( layer->subsetString() );
69 if ( !layer->setSubsetString( sql ) )
81 QHash<QgsMapLayer *, QString>::const_iterator filterIt = filterMap.constBegin();
82 for ( ; filterIt != filterMap.constEnd(); ++filterIt )
84 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.