QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsaccesscontrolfilter.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsaccesscontrolfilter.h
3 ------------------------
4 Access control interface for QGIS Server plugins
5
6 begin : 2015-05-19
7 copyright : (C) 2015 by Stéphane Brunner
8 email : stephane dot brunner at camptocamp dot org
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20#ifndef QGSACCESSCONTROLPLUGIN_H
21#define QGSACCESSCONTROLPLUGIN_H
22
23#include "qgis_server.h"
24#include "qgis_sip.h"
25
26#include <QMultiMap>
27#include <QString>
28
29SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )
30
32class QgsMapLayer;
33class QgsVectorLayer;
34class QgsFeature;
35
36
51class SERVER_EXPORT QgsAccessControlFilter
52{
53 public:
60
61 virtual ~QgsAccessControlFilter() = default;
62
65 {
66 bool canRead;
70 };
71
73 const QgsServerInterface *serverInterface() const { return mServerInterface; }
74
80 virtual QString layerFilterExpression( const QgsVectorLayer *layer ) const;
81
87 virtual QString layerFilterSubsetString( const QgsVectorLayer *layer ) const;
88
94 virtual LayerPermissions layerPermissions( const QgsMapLayer *layer ) const;
95
102 virtual QStringList authorizedLayerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const;
103
110 virtual bool allowToEdit( const QgsVectorLayer *layer, const QgsFeature &feature ) const;
111
116 virtual QString cacheKey() const;
117
118 private:
120 const QgsServerInterface *mServerInterface = nullptr;
121};
122
124typedef QMultiMap<int, QgsAccessControlFilter *> QgsAccessControlFilterMap;
125
126
127#endif // QGSSERVERSECURITY_H
const QgsServerInterface * serverInterface() const
Returns the QgsServerInterface instance.
QgsAccessControlFilter(const QgsServerInterface *serverInterface)
Constructor QgsServerInterface passed to plugins constructors and must be passed to QgsAccessControlF...
virtual ~QgsAccessControlFilter()=default
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
Base class for all map layer types.
Definition qgsmaplayer.h:80
Defines interfaces exposed by QGIS Server and made available to plugins.
Represents a vector layer which manages a vector based dataset.
#define SIP_IF_MODULE(condition)
Definition qgis_sip.h:28
QMultiMap< int, QgsAccessControlFilter * > QgsAccessControlFilterMap
The registry definition.