mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
118 lines
3.8 KiB
Plaintext
118 lines
3.8 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/server/qgsaccesscontrolfilter.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsAccessControlFilter
|
|
{
|
|
%Docstring
|
|
Class defining access control interface for QGIS Server plugins.
|
|
|
|
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()
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsaccesscontrolfilter.h"
|
|
%End
|
|
public:
|
|
|
|
QgsAccessControlFilter( const QgsServerInterface *serverInterface );
|
|
%Docstring
|
|
Constructor
|
|
QgsServerInterface passed to plugins constructors
|
|
and must be passed to QgsAccessControlFilter instances.
|
|
%End
|
|
|
|
virtual ~QgsAccessControlFilter();
|
|
|
|
struct LayerPermissions
|
|
{
|
|
bool canRead;
|
|
bool canUpdate;
|
|
bool canInsert;
|
|
bool canDelete;
|
|
};
|
|
|
|
const QgsServerInterface *serverInterface() const;
|
|
%Docstring
|
|
Return the QgsServerInterface instance
|
|
:rtype: QgsServerInterface
|
|
%End
|
|
|
|
virtual QString layerFilterExpression( const QgsVectorLayer *layer ) const;
|
|
%Docstring
|
|
Return an additional expression filter
|
|
\param layer the layer to control
|
|
:return: the filter expression
|
|
:rtype: str
|
|
%End
|
|
|
|
virtual QString layerFilterSubsetString( const QgsVectorLayer *layer ) const;
|
|
%Docstring
|
|
Return an additional subset string (typically SQL) filter
|
|
\param layer the layer to control
|
|
:return: the subset string
|
|
:rtype: str
|
|
%End
|
|
|
|
virtual LayerPermissions layerPermissions( const QgsMapLayer *layer ) const;
|
|
%Docstring
|
|
Return the layer permissions
|
|
\param layer the layer to control
|
|
:return: the permission to use on the layer
|
|
:rtype: LayerPermissions
|
|
%End
|
|
|
|
virtual QStringList authorizedLayerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const;
|
|
%Docstring
|
|
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
|
|
%End
|
|
|
|
virtual bool allowToEdit( const QgsVectorLayer *layer, const QgsFeature &feature ) const;
|
|
%Docstring
|
|
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
|
|
%End
|
|
|
|
virtual QString cacheKey() const;
|
|
%Docstring
|
|
Cache key to used to create the capabilities cache
|
|
:return: the cache key, "" for no cache
|
|
:rtype: str
|
|
%End
|
|
|
|
};
|
|
|
|
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 *
|
|
************************************************************************/
|