Class: QgsAccessControlFilter¶
Defines 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)
Methods
Returns the |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsAccessControlFilter. See the FAQ for more details.
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 |
- class qgis.server.QgsAccessControlFilter[source]¶
Bases:
object
- __init__(serverInterface: QgsServerInterface | None)
Constructor
QgsServerInterface
passed to plugins constructors and must be passed to QgsAccessControlFilter instances.- Parameters:
serverInterface (Optional[QgsServerInterface])
- __init__(a0: QgsAccessControlFilter)
- Parameters:
- class LayerPermissions¶
Bases:
object
Describe the layer permission
- canDelete¶
- canInsert¶
- canRead¶
- canUpdate¶
- virtual allowToEdit(self, layer: QgsVectorLayer | None, feature: QgsFeature) bool [source]¶
Are we authorized to modify the following geometry
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
feature (QgsFeature) – the concerned feature
- Return type:
bool
- Returns:
True
if we are allowed to edit
- virtual authorizedLayerAttributes(self, layer: QgsVectorLayer | None, attributes: Iterable[str | None]) List[str] [source]¶
Returns the authorized layer attributes
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
attributes (Iterable[Optional[str]]) – the current list of visible attribute
- Return type:
List[str]
- Returns:
the new list of visible attributes
- virtual cacheKey(self) str [source]¶
Cache key to used to create the capabilities cache
- Return type:
str
- Returns:
the cache key, “” for no cache
- virtual layerFilterExpression(self, layer: QgsVectorLayer | None) str [source]¶
Returns an additional expression filter
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
- Return type:
str
- Returns:
the filter expression
- virtual layerFilterSubsetString(self, layer: QgsVectorLayer | None) str [source]¶
Returns an additional subset string (typically SQL) filter
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
- Return type:
str
- Returns:
the subset string
- virtual layerPermissions(self, layer: QgsMapLayer | None) QgsAccessControlFilter.LayerPermissions [source]¶
Returns the layer permissions
- Parameters:
layer (Optional[QgsMapLayer]) – the layer to control
- Return type:
- Returns:
the permission to use on the layer
- serverInterface(self) QgsServerInterface | None [source]¶
Returns the
QgsServerInterface
instance- Return type:
Optional[QgsServerInterface]