QGIS/python/server/qgsaccesscontrolfilter.sip

131 lines
3.7 KiB
Plaintext
Raw Normal View History

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 *
************************************************************************/
2017-06-26 09:57:09 +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
%TypeHeaderCode
#include "qgsaccesscontrolfilter.h"
%End
public:
2017-06-26 09:57:09 +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
virtual ~QgsAccessControlFilter();
struct LayerPermissions
{
bool canRead;
bool canUpdate;
bool canInsert;
bool canDelete;
};
const QgsServerInterface *serverInterface() const;
2017-06-26 09:57:09 +02:00
%Docstring
Return the QgsServerInterface instance
2017-12-15 10:36:55 -04:00
:rtype: QgsServerInterface
2017-06-26 09:57:09 +02:00
%End
2016-10-01 11:23:26 +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
:param layer: the layer to control
:return: the filter expression
:rtype: str
2017-06-26 09:57:09 +02:00
%End
2016-10-01 11:23:26 +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
:param layer: the layer to control
:return: the subset string
:rtype: str
2017-06-26 09:57:09 +02:00
%End
2016-10-01 11:23:26 +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
:param layer: the layer to control
:return: the permission to use on the layer
:rtype: LayerPermissions
2017-06-26 09:57:09 +02:00
%End
2016-10-01 11:23:26 +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
:param layer: the layer to control
:param attributes: the current list of visible attribute
:return: the new list of visible attributes
:rtype: list of str
2017-06-26 09:57:09 +02:00
%End
2016-10-01 11:23:26 +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
:param layer: the layer to control
:param feature: the concerned feature
:return: true if we are allowed to edit
:rtype: bool
2017-06-26 09:57:09 +02:00
%End
2016-10-01 11:23:26 +02: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
:rtype: str
2017-06-26 09:57:09 +02:00
%End
};
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 *
************************************************************************/