Class: QgsAccessControl¶
A helper class that centralizes restrictions given by all the access control filter plugins.
Class Hierarchy¶
Base classes¶
Abstract interface for use by classes that filter the features or attributes of a layer. |
Abstract Methods
Returns a clone of the object |
|
Filter the features of the layer |
|
Returns the authorized layer attributes |
Methods
Are we authorized to modify the following geometry |
|
Returns an additional subset string (typically SQL) filter |
|
Fill the capabilities caching key |
|
Returns the layer delete right |
|
Returns the layer insert right |
|
Returns the layer read right |
|
Returns the layer update right |
|
Register an access control filter |
|
Resolve features' filter of layers The method fetch filter's expressions returned from access control plugins and and combine them to a unique expression for each layer. |
|
Clear expression's cache computed from resolveFilterFeatures |
- class qgis.server.QgsAccessControl[source]¶
Bases:
QgsFeatureFilterProvider
- __init__()
Constructor
- __init__(copy: QgsAccessControl)
- Parameters:
copy (QgsAccessControl)
- 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 the feature
- abstract clone(self) QgsFeatureFilterProvider | None [source]¶
Returns a clone of the object
- Return type:
Optional[QgsFeatureFilterProvider]
- Returns:
A clone
- extraSubsetString(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 to use
- fillCacheKey(self, cacheKey: Iterable[str | None]) bool [source]¶
Fill the capabilities caching key
- Parameters:
cacheKey (Iterable[Optional[str]]) – the list to fill with a cache variant
- Return type:
bool
- abstract filterFeatures(self, layer: QgsVectorLayer | None, filterFeatures: QgsFeatureRequest)[source]¶
Filter the features of the layer
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
filterFeatures (QgsFeatureRequest) – the request to fill
- abstract layerAttributes(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 list of attribute
- Return type:
List[str]
- Returns:
the list of visible attributes
- layerDeletePermission(self, layer: QgsVectorLayer | None) bool [source]¶
Returns the layer delete right
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
- Return type:
bool
- Returns:
True
if we can do a delete
- layerInsertPermission(self, layer: QgsVectorLayer | None) bool [source]¶
Returns the layer insert right
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
- Return type:
bool
- Returns:
True
if we can insert on it
- layerReadPermission(self, layer: QgsMapLayer | None) bool [source]¶
Returns the layer read right
- Parameters:
layer (Optional[QgsMapLayer]) – the layer to control
- Return type:
bool
- Returns:
True
if it can be read
- layerUpdatePermission(self, layer: QgsVectorLayer | None) bool [source]¶
Returns the layer update right
- Parameters:
layer (Optional[QgsVectorLayer]) – the layer to control
- Return type:
bool
- Returns:
True
if we can do an update
- registerAccessControl(self, accessControl: QgsAccessControlFilter | None, priority: int = 0)[source]¶
Register an access control filter
- Parameters:
accessControl (Optional[QgsAccessControlFilter]) – the access control to add
priority (int = 0) – the priority used to define the order
- resolveFilterFeatures(self, layers: Iterable[QgsMapLayer])[source]¶
Resolve features’ filter of layers The method fetch filter’s expressions returned from access control plugins and and combine them to a unique expression for each layer. The resulted expressions are stored in cache for efficiency; between each requests, the cache must be cleared using ‘
unresolveFilterFeatures()
’.- Parameters:
layers (Iterable[QgsMapLayer]) – to filter