40 QStringList expressions = QStringList();
41 QgsAccessControlFilterMap::const_iterator acIterator;
43 for ( acIterator = mPluginsAccessControls->constBegin(); acIterator != mPluginsAccessControls->constEnd(); ++acIterator )
45 QString expression = acIterator.value()->layerFilterExpression( layer );
46 if ( !expression.isEmpty() )
48 expressions.append( expression );
53 if ( !expressions.isEmpty() )
55 expression = QStringLiteral(
"((" ).append( expressions.join( QStringLiteral(
") AND (" ) ) ).append(
"))" );
67 if ( mResolved && mFilterFeaturesExpressions.keys().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 QString sql = acIterator.value()->layerFilterSubsetString( layer );
101 return sqls.isEmpty() ? QString() : QStringLiteral(
"((" ).append( sqls.join( QStringLiteral(
") 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 QString newKey = acIterator.value()->cacheKey();
193 if ( newKey.length() == 0 )
206 mPluginsAccessControls->insert( priority, accessControl );