Class: QgsAccessControlFilter

class qgis.server.QgsAccessControlFilter(serverInterface: QgsServerInterface)

Bases: sip.wrapper

Constructor QgsServerInterface passed to plugins constructors and must be passed to QgsAccessControlFilter instances.

QgsAccessControlFilter(QgsAccessControlFilter)

Class defining access control interface for QGIS Server plugins.

Security can define any (or none) of the following method: * layerFilterExpression() - To get an additional expression filter (WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature) * layerFilterSQL() - To get an additional SQL filter (WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature) for layer that support SQL * layerPermissions() - To give the general layer permissins (read / update / insert / delete) * authorizedLayerAttributes() - Tho filter the attributes (WMS/GetFeatureInfo, WFS/GetFeature) * allowToEdit() - (all WFS-T requests) * cacheKey()

Methods

allowToEdit Are we authorized to modify the following geometry
authorizedLayerAttributes Returns the authorized layer attributes
cacheKey Cache key to used to create the capabilities cache
layerFilterExpression Returns an additional expression filter
layerFilterSubsetString Returns an additional subset string (typically SQL) filter
layerPermissions Returns the layer permissions
serverInterface Returns the QgsServerInterface instance

Signals

Attributes

class LayerPermissions

Bases: sip.wrapper

QgsAccessControlFilter.LayerPermissions(QgsAccessControlFilter.LayerPermissions)

canDelete
canInsert
canRead
canUpdate
allowToEdit(self, layer: QgsVectorLayer, feature: QgsFeature) → bool

Are we authorized to modify the following geometry

Parameters:
  • layer – the layer to control
  • feature – the concerned feature
Returns:

true if we are allowed to edit

authorizedLayerAttributes(self, layer: QgsVectorLayer, attributes: Iterable[str]) → List[str]

Returns the authorized layer attributes

Parameters:
  • layer – the layer to control
  • attributes – the current list of visible attribute
Returns:

the new list of visible attributes

cacheKey(self) → str

Cache key to used to create the capabilities cache

Returns:the cache key, “” for no cache
layerFilterExpression(self, layer: QgsVectorLayer) → str

Returns an additional expression filter

Parameters:layer – the layer to control
Returns:the filter expression
layerFilterSubsetString(self, layer: QgsVectorLayer) → str

Returns an additional subset string (typically SQL) filter

Parameters:layer – the layer to control
Returns:the subset string
layerPermissions(self, layer: QgsMapLayer) → QgsAccessControlFilter.LayerPermissions

Returns the layer permissions

Parameters:layer – the layer to control
Returns:the permission to use on the layer
serverInterface(self) → QgsServerInterface

Returns the QgsServerInterface instance