2017-06-26 09:57:09 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/server/qgsaccesscontrol.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
|
The plugin define the following methods:
* layerFilterExpression
Return an additional filter, used in
WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature to filter the features
* layerFilterSubsetString
Return an additional the subset string (typically SQL) filter.
Faster than the layerFilterExpression but not supported on all the
type of layer
* layerPermissions
Change the rights on the layer per user (known by the plugin)
Concern rights: publish, insert, update, delete.
Mostly used in WFS/Transaction, and the publish in all requests.
* authorizedLayerAttributes
Be able to show some attributes only for a subset of user
Used in: WMS/GetFeatureInfo, WFS/GetFeature
* allowToEdit
Be able to don't allow to edit a particular feature, in our case base
on the Geometry
Used in: WFS/Transaction
* cacheKey
Cache key to used to create the capabilities cache, "" for no cache,
shouldn't contains any "-", default to ""
2015-05-19 15:53:51 +02:00
|
|
|
class QgsAccessControl : QgsFeatureFilterProvider
|
|
|
|
{
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
|
|
|
A helper class that centralize the restrictions given by all the
|
2017-12-15 10:36:55 -04:00
|
|
|
access control filter plugins.
|
2017-06-26 09:57:09 +02:00
|
|
|
*
|
|
|
|
%End
|
|
|
|
|
The plugin define the following methods:
* layerFilterExpression
Return an additional filter, used in
WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature to filter the features
* layerFilterSubsetString
Return an additional the subset string (typically SQL) filter.
Faster than the layerFilterExpression but not supported on all the
type of layer
* layerPermissions
Change the rights on the layer per user (known by the plugin)
Concern rights: publish, insert, update, delete.
Mostly used in WFS/Transaction, and the publish in all requests.
* authorizedLayerAttributes
Be able to show some attributes only for a subset of user
Used in: WMS/GetFeatureInfo, WFS/GetFeature
* allowToEdit
Be able to don't allow to edit a particular feature, in our case base
on the Geometry
Used in: WFS/Transaction
* cacheKey
Cache key to used to create the capabilities cache, "" for no cache,
shouldn't contains any "-", default to ""
2015-05-19 15:53:51 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsaccesscontrol.h"
|
|
|
|
#include "qgsaccesscontrolfilter.h"
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
public:
|
|
|
|
QgsAccessControl();
|
|
|
|
%Docstring
|
|
|
|
Constructor
|
|
|
|
%End
|
|
|
|
|
|
|
|
QgsAccessControl( const QgsAccessControl © );
|
|
|
|
%Docstring
|
|
|
|
Constructor
|
|
|
|
%End
|
|
|
|
|
|
|
|
|
|
|
|
~QgsAccessControl();
|
|
|
|
|
|
|
|
void resolveFilterFeatures( const QList<QgsMapLayer *> &layers );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Resolve features' filter of layers
|
|
|
|
:param layers: to filter
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
2017-12-12 11:44:10 +10:00
|
|
|
virtual void filterFeatures( const QgsVectorLayer *layer, QgsFeatureRequest &filterFeatures ) const;
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Filter the features of the layer
|
|
|
|
:param layer: the layer to control
|
|
|
|
:param filterFeatures: the request to fill
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
The plugin define the following methods:
* layerFilterExpression
Return an additional filter, used in
WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature to filter the features
* layerFilterSubsetString
Return an additional the subset string (typically SQL) filter.
Faster than the layerFilterExpression but not supported on all the
type of layer
* layerPermissions
Change the rights on the layer per user (known by the plugin)
Concern rights: publish, insert, update, delete.
Mostly used in WFS/Transaction, and the publish in all requests.
* authorizedLayerAttributes
Be able to show some attributes only for a subset of user
Used in: WMS/GetFeatureInfo, WFS/GetFeature
* allowToEdit
Be able to don't allow to edit a particular feature, in our case base
on the Geometry
Used in: WFS/Transaction
* cacheKey
Cache key to used to create the capabilities cache, "" for no cache,
shouldn't contains any "-", default to ""
2015-05-19 15:53:51 +02:00
|
|
|
|
2017-12-12 11:44:10 +10:00
|
|
|
virtual QgsFeatureFilterProvider *clone() const /Factory/;
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return a clone of the object
|
|
|
|
|
|
|
|
:return: A clone
|
|
|
|
:rtype: QgsFeatureFilterProvider
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QString extraSubsetString( const QgsVectorLayer *layer ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return an additional subset string (typically SQL) filter
|
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: the subset string to use
|
|
|
|
:rtype: str
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool layerReadPermission( const QgsMapLayer *layer ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the layer read right
|
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: true if it can be read
|
|
|
|
:rtype: bool
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool layerInsertPermission( const QgsVectorLayer *layer ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the layer insert right
|
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: true if we can insert on it
|
|
|
|
:rtype: bool
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool layerUpdatePermission( const QgsVectorLayer *layer ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the layer update right
|
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: true if we can do an update
|
|
|
|
:rtype: bool
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool layerDeletePermission( const QgsVectorLayer *layer ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the layer delete right
|
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: true if we can do a delete
|
|
|
|
:rtype: bool
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
QStringList layerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the authorized layer attributes
|
|
|
|
:param layer: the layer to control
|
|
|
|
:param attributes: the list of attribute
|
|
|
|
|
|
|
|
:return: the list of visible attributes
|
|
|
|
:rtype: list of str
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool allowToEdit( const QgsVectorLayer *layer, const QgsFeature &feature ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Are we authorized to modify the following geometry
|
|
|
|
:param layer: the layer to control
|
|
|
|
:param feature: the concerned feature
|
|
|
|
|
|
|
|
:return: true if we are allowed to edit the feature
|
|
|
|
:rtype: bool
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
bool fillCacheKey( QStringList &cacheKey ) const;
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Fill the capabilities caching key
|
|
|
|
:param cacheKey: the list to fill with a cache variant
|
|
|
|
|
|
|
|
:return: false if we can't create a cache
|
|
|
|
:rtype: bool
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
void registerAccessControl( QgsAccessControlFilter *accessControl, int priority = 0 );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Register an access control filter
|
|
|
|
:param accessControl: the access control to add
|
|
|
|
:param priority: the priority used to define the order
|
The plugin define the following methods:
* layerFilterExpression
Return an additional filter, used in
WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature to filter the features
* layerFilterSubsetString
Return an additional the subset string (typically SQL) filter.
Faster than the layerFilterExpression but not supported on all the
type of layer
* layerPermissions
Change the rights on the layer per user (known by the plugin)
Concern rights: publish, insert, update, delete.
Mostly used in WFS/Transaction, and the publish in all requests.
* authorizedLayerAttributes
Be able to show some attributes only for a subset of user
Used in: WMS/GetFeatureInfo, WFS/GetFeature
* allowToEdit
Be able to don't allow to edit a particular feature, in our case base
on the Geometry
Used in: WFS/Transaction
* cacheKey
Cache key to used to create the capabilities cache, "" for no cache,
shouldn't contains any "-", default to ""
2015-05-19 15:53:51 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
};
|
2017-06-26 09:57:09 +02:00
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/server/qgsaccesscontrol.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|