Class: QgsAccessControlFilter¶
- class qgis.server.QgsAccessControlFilter¶
Bases:
sip.wrapper
Class defining access control interface for QGIS Server plugins.
Security can define any (or none) of the following method:
layerFilterExpression()
- To set an additional QGIS expression filter (WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature)layerFilterSubsetString()
- To set an additional SQL subset string filter (WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature) for layer that support SQLlayerPermissions()
- To set the general layer permissins (read / update / insert / delete)authorizedLayerAttributes()
- To filter the attributes (WMS/GetFeatureInfo, WFS/GetFeature)allowToEdit()
- (all WFS-T requests)
QgsAccessControlFilter(serverInterface:
QgsServerInterface
) ConstructorQgsServerInterface
passed to plugins constructors and must be passed toQgsAccessControlFilter
instances.QgsAccessControlFilter(
QgsAccessControlFilter
)Methods
Are we authorized to modify the following geometry
Returns the authorized layer attributes
Cache key to used to create the capabilities cache
Returns an additional expression filter
Returns an additional subset string (typically SQL) filter
Returns the layer permissions
Returns the
QgsServerInterface
instance- class LayerPermissions¶
- class LayerPermissions(QgsAccessControlFilter.LayerPermissions)
Bases:
sip.wrapper
- canDelete¶
- canInsert¶
- canRead¶
- canUpdate¶
- allowToEdit(self, layer: QgsVectorLayer, feature: QgsFeature) bool ¶
Are we authorized to modify the following geometry
- Parameters:
layer (QgsVectorLayer) – the layer to control
feature (QgsFeature) – the concerned feature
- Return type:
bool
- Returns:
True
if we are allowed to edit
- authorizedLayerAttributes(self, layer: QgsVectorLayer, attributes: Iterable[str]) List[str] ¶
Returns the authorized layer attributes
- Parameters:
layer (QgsVectorLayer) – the layer to control
attributes (Iterable[str]) – the current list of visible attribute
- Return type:
List[str]
- Returns:
the new list of visible attributes
- cacheKey(self) str ¶
Cache key to used to create the capabilities cache
- Return type:
str
- Returns:
the cache key, “” for no cache
- layerFilterExpression(self, layer: QgsVectorLayer) str ¶
Returns an additional expression filter
- Parameters:
layer (QgsVectorLayer) – the layer to control
- Return type:
str
- Returns:
the filter expression
- layerFilterSubsetString(self, layer: QgsVectorLayer) str ¶
Returns an additional subset string (typically SQL) filter
- Parameters:
layer (QgsVectorLayer) – the layer to control
- Return type:
str
- Returns:
the subset string
- layerPermissions(self, layer: QgsMapLayer) QgsAccessControlFilter.LayerPermissions ¶
Returns the layer permissions
- Parameters:
layer (QgsMapLayer) – the layer to control
- Return type:
- Returns:
the permission to use on the layer
- serverInterface(self) QgsServerInterface ¶
Returns the
QgsServerInterface
instance- Return type: