40 QStringList expressions = QStringList();
41 QgsAccessControlFilterMap::const_iterator acIterator;
43 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
45 const QString expression = acIterator.value()->layerFilterExpression( layer );
46 if ( !expression.isEmpty() )
48 expressions.append( expression );
53 if ( !expressions.isEmpty() )
55 expression = QStringLiteral(
"((" ).append( expressions.join( QLatin1String(
") AND (" ) ) ).append(
"))" );
67 if ( mResolved && mFilterFeaturesExpressions.contains( layer->
id() ) )
69 expression = mFilterFeaturesExpressions[layer->
id()];
76 if ( !expression.isEmpty() )
92 QgsAccessControlFilterMap::const_iterator acIterator;
93 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
95 const QString sql = acIterator.value()->layerFilterSubsetString( layer );
101 return sqls.isEmpty() ? QString() : QStringLiteral(
"((" ).append( sqls.join( QLatin1String(
") AND (" ) ) ).append(
"))" );
107 QgsAccessControlFilterMap::const_iterator acIterator;
108 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
110 if ( !acIterator.value()->layerPermissions( layer ).canRead )
121 QgsAccessControlFilterMap::const_iterator acIterator;
122 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
124 if ( !acIterator.value()->layerPermissions( layer ).canInsert )
135 QgsAccessControlFilterMap::const_iterator acIterator;
136 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
138 if ( !acIterator.value()->layerPermissions( layer ).canUpdate )
149 QgsAccessControlFilterMap::const_iterator acIterator;
150 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
152 if ( !acIterator.value()->layerPermissions( layer ).canDelete )
163 QStringList currentAttributes( attributes );
164 QgsAccessControlFilterMap::const_iterator acIterator;
165 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
167 currentAttributes = acIterator.value()->authorizedLayerAttributes( layer, currentAttributes );
169 return currentAttributes;
175 QgsAccessControlFilterMap::const_iterator acIterator;
176 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
178 if ( !acIterator.value()->allowToEdit( layer, feature ) )
189 QgsAccessControlFilterMap::const_iterator acIterator;
190 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
192 const QString newKey = acIterator.value()->cacheKey();
193 if ( ! newKey.isEmpty() )
205 mPluginsAccessControls->insert( priority, accessControl );