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

Detailed Description

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

Since
QGIS 2.14

Definition at line 39 of file qgsaccesscontrol.h.

Constructor & Destructor Documentation

QgsAccessControl::QgsAccessControl ( )
inline

Constructor.

Definition at line 47 of file qgsaccesscontrol.h.

QgsAccessControl::QgsAccessControl ( const QgsAccessControl copy)
inline

Constructor.

Definition at line 54 of file qgsaccesscontrol.h.

QgsAccessControl::~QgsAccessControl ( )
inlineoverride

Definition at line 62 of file qgsaccesscontrol.h.

Member Function Documentation

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 174 of file qgsaccesscontrol.cpp.

QgsFeatureFilterProvider * QgsAccessControl::clone ( ) const
overridevirtual

Returns a clone of the object.

Clone the object.

Returns
A clone

Implements QgsFeatureFilterProvider.

Definition at line 84 of file qgsaccesscontrol.cpp.

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 90 of file qgsaccesscontrol.cpp.

bool QgsAccessControl::fillCacheKey ( QStringList &  cacheKey) const

Fill the capabilities caching key.

Parameters
cacheKeythe list to fill with a cache variant
Returns
false if we can't create a cache

Definition at line 188 of file qgsaccesscontrol.cpp.

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 63 of file qgsaccesscontrol.cpp.

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

Returns the authorized layer attributes.

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

Definition at line 162 of file qgsaccesscontrol.cpp.

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 148 of file qgsaccesscontrol.cpp.

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 120 of file qgsaccesscontrol.cpp.

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 106 of file qgsaccesscontrol.cpp.

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 134 of file qgsaccesscontrol.cpp.

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 205 of file qgsaccesscontrol.cpp.

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

Resolve features' filter of layers.

Parameters
layersto filter

Definition at line 25 of file qgsaccesscontrol.cpp.


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