QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsAccessControl Class Reference

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

#include <qgsaccesscontrol.h>

Inheritance diagram for QgsAccessControl:
Inheritance graph
[legend]

Public Member Functions

 QgsAccessControl ()
 Constructor.
 
 QgsAccessControl (const QgsAccessControl &copy)
 
 ~QgsAccessControl () override
 
bool allowToEdit (const QgsVectorLayer *layer, const QgsFeature &feature) const
 Are we authorized to modify the following geometry.
 
QgsFeatureFilterProviderclone () const override
 Returns a clone of the object.
 
QString extraSubsetString (const QgsVectorLayer *layer) const
 Returns an additional subset string (typically SQL) filter.
 
bool fillCacheKey (QStringList &cacheKey) const
 Fill the capabilities caching key.
 
void filterFeatures (const QgsVectorLayer *layer, QgsFeatureRequest &filterFeatures) const override
 Filter the features of the layer.
 
QStringList layerAttributes (const QgsVectorLayer *layer, const QStringList &attributes) const override
 Returns the authorized layer attributes.
 
bool layerDeletePermission (const QgsVectorLayer *layer) const
 Returns the layer delete right.
 
bool layerInsertPermission (const QgsVectorLayer *layer) const
 Returns the layer insert right.
 
bool layerReadPermission (const QgsMapLayer *layer) const
 Returns the layer read right.
 
bool layerUpdatePermission (const QgsVectorLayer *layer) const
 Returns the layer update right.
 
QgsAccessControloperator= (const QgsAccessControl &other)
 
void registerAccessControl (QgsAccessControlFilter *accessControl, int priority=0)
 Register an access control filter.
 
void resolveFilterFeatures (const QList< QgsMapLayer * > &layers)
 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.
 
void unresolveFilterFeatures ()
 Clear expression's cache computed from resolveFilterFeatures
 
- Public Member Functions inherited from QgsFeatureFilterProvider
 QgsFeatureFilterProvider ()=default
 
virtual ~QgsFeatureFilterProvider ()=default
 

Detailed Description

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

Definition at line 35 of file qgsaccesscontrol.h.

Constructor & Destructor Documentation

◆ QgsAccessControl() [1/2]

QgsAccessControl::QgsAccessControl ( )
inline

Constructor.

Definition at line 43 of file qgsaccesscontrol.h.

◆ QgsAccessControl() [2/2]

QgsAccessControl::QgsAccessControl ( const QgsAccessControl copy)
inline

Definition at line 49 of file qgsaccesscontrol.h.

◆ ~QgsAccessControl()

QgsAccessControl::~QgsAccessControl ( )
inlineoverride

Definition at line 57 of file qgsaccesscontrol.h.

Member Function Documentation

◆ allowToEdit()

bool QgsAccessControl::allowToEdit ( const QgsVectorLayer layer,
const QgsFeature feature 
) const

Are we authorized to modify the following geometry.

Parameters
layerthe layer to control
featurethe concerned feature
Returns
true if we are allowed to edit the feature

Definition at line 180 of file qgsaccesscontrol.cpp.

◆ clone()

QgsFeatureFilterProvider * QgsAccessControl::clone ( ) const
overridevirtual

Returns a clone of the object.

Clone the object.

Returns
A clone

Implements QgsFeatureFilterProvider.

Definition at line 90 of file qgsaccesscontrol.cpp.

◆ extraSubsetString()

QString QgsAccessControl::extraSubsetString ( const QgsVectorLayer layer) const

Returns an additional subset string (typically SQL) filter.

Parameters
layerthe layer to control
Returns
the subset string to use

Definition at line 96 of file qgsaccesscontrol.cpp.

◆ fillCacheKey()

bool QgsAccessControl::fillCacheKey ( QStringList &  cacheKey) const

Fill the capabilities caching key.

Parameters
cacheKeythe list to fill with a cache variant

Definition at line 194 of file qgsaccesscontrol.cpp.

◆ filterFeatures()

void QgsAccessControl::filterFeatures ( const QgsVectorLayer layer,
QgsFeatureRequest filterFeatures 
) const
overridevirtual

Filter the features of the layer.

Parameters
layerthe layer to control
filterFeaturesthe request to fill

Implements QgsFeatureFilterProvider.

Definition at line 69 of file qgsaccesscontrol.cpp.

◆ layerAttributes()

QStringList QgsAccessControl::layerAttributes ( const QgsVectorLayer layer,
const QStringList &  attributes 
) const
overridevirtual

Returns the authorized layer attributes.

Parameters
layerthe layer to control
attributesthe list of attribute
Returns
the list of visible attributes

Implements QgsFeatureFilterProvider.

Definition at line 168 of file qgsaccesscontrol.cpp.

◆ layerDeletePermission()

bool QgsAccessControl::layerDeletePermission ( const QgsVectorLayer layer) const

Returns the layer delete right.

Parameters
layerthe layer to control
Returns
true if we can do a delete

Definition at line 154 of file qgsaccesscontrol.cpp.

◆ layerInsertPermission()

bool QgsAccessControl::layerInsertPermission ( const QgsVectorLayer layer) const

Returns the layer insert right.

Parameters
layerthe layer to control
Returns
true if we can insert on it

Definition at line 126 of file qgsaccesscontrol.cpp.

◆ layerReadPermission()

bool QgsAccessControl::layerReadPermission ( const QgsMapLayer layer) const

Returns the layer read right.

Parameters
layerthe layer to control
Returns
true if it can be read

Definition at line 112 of file qgsaccesscontrol.cpp.

◆ layerUpdatePermission()

bool QgsAccessControl::layerUpdatePermission ( const QgsVectorLayer layer) const

Returns the layer update right.

Parameters
layerthe layer to control
Returns
true if we can do an update

Definition at line 140 of file qgsaccesscontrol.cpp.

◆ operator=()

QgsAccessControl & QgsAccessControl::operator= ( const QgsAccessControl other)
inline

Definition at line 62 of file qgsaccesscontrol.h.

◆ registerAccessControl()

void QgsAccessControl::registerAccessControl ( QgsAccessControlFilter accessControl,
int  priority = 0 
)

Register an access control filter.

Register a new access control filter.

Parameters
accessControlthe access control to add
prioritythe priority used to define the order

Definition at line 210 of file qgsaccesscontrol.cpp.

◆ resolveFilterFeatures()

void QgsAccessControl::resolveFilterFeatures ( const QList< QgsMapLayer * > &  layers)

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
layersto filter

Definition at line 24 of file qgsaccesscontrol.cpp.

◆ unresolveFilterFeatures()

void QgsAccessControl::unresolveFilterFeatures ( )

Clear expression's cache computed from resolveFilterFeatures

Clear feature's filter of layers.

Definition at line 62 of file qgsaccesscontrol.cpp.


The documentation for this class was generated from the following files: