2017-06-26 09:57:09 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/server/qgsaccesscontrolfilter.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-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 QgsAccessControlFilter
|
|
|
|
{
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
|
|
|
Class defining access control interface for QGIS Server plugins.
|
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Security can define any (or none) of the following method:
|
|
|
|
* layerFilterExpression() - To get an additional expression filter (WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature)
|
|
|
|
* layerFilterSQL() - To get an additional SQL filter (WMS/GetMap, WMS/GetFeatureInfo, WFS/GetFeature) for layer that support SQL
|
|
|
|
* layerPermissions() - To give the general layer permissins (read / update / insert / delete)
|
|
|
|
* authorizedLayerAttributes() - Tho filter the attributes (WMS/GetFeatureInfo, WFS/GetFeature)
|
|
|
|
* allowToEdit() - (all WFS-T requests)
|
|
|
|
* cacheKey()
|
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 "qgsaccesscontrolfilter.h"
|
|
|
|
%End
|
|
|
|
public:
|
2017-06-26 09:57:09 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
QgsAccessControlFilter( const QgsServerInterface *serverInterface );
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor
|
|
|
|
QgsServerInterface passed to plugins constructors
|
|
|
|
and must be passed to QgsAccessControlFilter instances.
|
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
|
|
|
virtual ~QgsAccessControlFilter();
|
|
|
|
|
|
|
|
struct LayerPermissions
|
|
|
|
{
|
|
|
|
bool canRead;
|
|
|
|
bool canUpdate;
|
|
|
|
bool canInsert;
|
|
|
|
bool canDelete;
|
|
|
|
};
|
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
const QgsServerInterface *serverInterface() const;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
|
|
|
Return the QgsServerInterface instance
|
|
|
|
%End
|
2016-10-01 11:23:26 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QString layerFilterExpression( const QgsVectorLayer *layer ) const;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return an additional expression filter
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: the filter expression
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-10-01 11:23:26 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QString layerFilterSubsetString( const QgsVectorLayer *layer ) const;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return an additional subset string (typically SQL) filter
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: the subset string
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-10-01 11:23:26 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual LayerPermissions layerPermissions( const QgsMapLayer *layer ) const;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the layer permissions
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param layer: the layer to control
|
|
|
|
|
|
|
|
:return: the permission to use on the layer
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-10-01 11:23:26 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual QStringList authorizedLayerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the authorized layer attributes
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param layer: the layer to control
|
|
|
|
:param attributes: the current list of visible attribute
|
|
|
|
|
|
|
|
:return: the new list of visible attributes
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-10-01 11:23:26 +02:00
|
|
|
|
2017-05-01 16:42:33 +02:00
|
|
|
virtual bool allowToEdit( const QgsVectorLayer *layer, const QgsFeature &feature ) const;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Are we authorized to modify the following geometry
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param layer: the layer to control
|
|
|
|
:param feature: the concerned feature
|
|
|
|
|
|
|
|
:return: true if we are allowed to edit
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-10-01 11:23:26 +02:00
|
|
|
|
2016-01-07 16:26:59 +11:00
|
|
|
virtual QString cacheKey() const;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Cache key to used to create the capabilities cache
|
|
|
|
|
|
|
|
:return: the cache key, "" for no cache
|
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-06-26 09:57:09 +02:00
|
|
|
typedef QMultiMap<int, QgsAccessControlFilter *> QgsAccessControlFilterMap;
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/server/qgsaccesscontrolfilter.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|