Subgroup: Access

Class: QgsAccessControl

class qgis.server.QgsAccessControl

Bases: qgis._core.QgsFeatureFilterProvider

Constructor

QgsAccessControl(copy: QgsAccessControl) Constructor

A helper class that centralizes restrictions given by all the access control filter plugins.

New in version 2.14: Methods

allowToEdit Are we authorized to modify the following geometry
clone Returns a clone of the object
extraSubsetString Returns an additional subset string (typically SQL) filter
fillCacheKey Fill the capabilities caching key
filterFeatures Filter the features of the layer
layerAttributes Returns the authorized layer attributes
layerDeletePermission Returns the layer delete right
layerInsertPermission Returns the layer insert right
layerReadPermission Returns the layer read right
layerUpdatePermission Returns the layer update right
registerAccessControl Register an access control filter
resolveFilterFeatures Resolve features’ filter of layers

Signals

Attributes

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 the feature

clone(self) → QgsFeatureFilterProvider

Returns a clone of the object

Returns:A clone
extraSubsetString(self, layer: QgsVectorLayer) → str

Returns an additional subset string (typically SQL) filter

Parameters:layer – the layer to control
Returns:the subset string to use
fillCacheKey(self, cacheKey: Iterable[str]) → bool

Fill the capabilities caching key

Parameters:cacheKey – the list to fill with a cache variant
Returns:false if we can’t create a cache
filterFeatures(self, layer: QgsVectorLayer, filterFeatures: QgsFeatureRequest)

Filter the features of the layer

Parameters:
  • layer – the layer to control
  • filterFeatures – the request to fill
layerAttributes(self, layer: QgsVectorLayer, attributes: Iterable[str]) → List[str]

Returns the authorized layer attributes

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

the list of visible attributes

layerDeletePermission(self, layer: QgsVectorLayer) → bool

Returns the layer delete right

Parameters:layer – the layer to control
Returns:true if we can do a delete
layerInsertPermission(self, layer: QgsVectorLayer) → bool

Returns the layer insert right

Parameters:layer – the layer to control
Returns:true if we can insert on it
layerReadPermission(self, layer: QgsMapLayer) → bool

Returns the layer read right

Parameters:layer – the layer to control
Returns:true if it can be read
layerUpdatePermission(self, layer: QgsVectorLayer) → bool

Returns the layer update right

Parameters:layer – the layer to control
Returns:true if we can do an update
registerAccessControl(self, accessControl: QgsAccessControlFilter, priority: int = 0)

Register an access control filter

Parameters:
  • accessControl – the access control to add
  • priority – the priority used to define the order
resolveFilterFeatures(self, layers: Iterable[QgsMapLayer])

Resolve features’ filter of layers

Parameters:layers – to filter