QGIS API Documentation  2.14.0-Essen
qgsaccesscontrolfilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsaccesscontrolfilter.h
3  ------------------------
4  begin : 2015-05-19
5  copyright : (C) 2015 by Stéphane Brunner
6  email : stephane dot brunner at camptocamp dot org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSACCESSCONTROLPLUGIN_H
19 #define QGSACCESSCONTROLPLUGIN_H
20 
21 #include <QMultiMap>
22 #include <QList>
23 #include <QString>
24 
25 class QgsServerInterface;
26 class QgsMapLayer;
27 class QgsVectorLayer;
28 class QgsExpression;
29 class QgsFeature;
30 
31 
44 class SERVER_EXPORT QgsAccessControlFilter
45 {
46 
47  public:
48 
53  QgsAccessControlFilter( const QgsServerInterface* serverInterface );
55  virtual ~QgsAccessControlFilter();
56 
59  {
60  bool canRead;
61  bool canUpdate;
62  bool canInsert;
63  bool canDelete;
64  };
65 
67  const QgsServerInterface* serverInterface() const { return mServerInterface; }
68 
73  virtual QString layerFilterExpression( const QgsVectorLayer* layer ) const;
74 
79  virtual QString layerFilterSubsetString( const QgsVectorLayer* layer ) const;
80 
85  virtual LayerPermissions layerPermissions( const QgsMapLayer* layer ) const;
86 
92  virtual QStringList authorizedLayerAttributes( const QgsVectorLayer* layer, const QStringList& attributes ) const;
93 
99  virtual bool allowToEdit( const QgsVectorLayer* layer, const QgsFeature& feature ) const;
100 
104  virtual QString cacheKey() const;
105 
106  private:
107 
109  const QgsServerInterface* mServerInterface;
110 
111 };
112 
115 
116 
117 #endif // QGSSERVERSECURITY_H
Class for parsing and evaluation of expressions (formerly called "search strings").
Base class for all map layer types.
Definition: qgsmaplayer.h:49
const QgsServerInterface * serverInterface() const
Return the QgsServerInterface instance.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
Class defining access control interface for QGIS Server plugins.
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
QMultiMap< int, QgsAccessControlFilter * > QgsAccessControlFilterMap
The registry definition.
Represents a vector layer which manages a vector based data sets.