QGIS API Documentation 3.41.0-Master (cea29feecf2)
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 <QMultiMap>
24#include <QString>
25#include "qgis_server.h"
26#include "qgis_sip.h"
27
28SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )
29
31class QgsMapLayer;
32class QgsVectorLayer;
33class QgsFeature;
34
35
50class SERVER_EXPORT QgsAccessControlFilter
51{
52 public:
58 QgsAccessControlFilter( const QgsServerInterface *serverInterface );
59
60 virtual ~QgsAccessControlFilter() = default;
61
64 {
65 bool canRead;
69 };
70
72 const QgsServerInterface *serverInterface() const { return mServerInterface; }
73
79 virtual QString layerFilterExpression( const QgsVectorLayer *layer ) const;
80
86 virtual QString layerFilterSubsetString( const QgsVectorLayer *layer ) const;
87
93 virtual LayerPermissions layerPermissions( const QgsMapLayer *layer ) const;
94
101 virtual QStringList authorizedLayerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const;
102
109 virtual bool allowToEdit( const QgsVectorLayer *layer, const QgsFeature &feature ) const;
110
115 virtual QString cacheKey() const;
116
117 private:
119 const QgsServerInterface *mServerInterface = nullptr;
120};
121
123typedef QMultiMap<int, QgsAccessControlFilter *> QgsAccessControlFilterMap;
124
125
126#endif // QGSSERVERSECURITY_H
Class defining access control interface for QGIS Server plugins.
const QgsServerInterface * serverInterface() const
Returns the QgsServerInterface instance.
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:76
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
Represents a vector layer which manages a vector based data sets.
#define SIP_IF_MODULE(condition)
Definition qgis_sip.h:28
QMultiMap< int, QgsAccessControlFilter * > QgsAccessControlFilterMap
The registry definition.