Skip to content
Permalink
Browse files

sipify server

  • Loading branch information
3nids committed Jun 26, 2017
1 parent 9068fea commit b7d524c111ca1d0cd57c814b0623cf5fa0660339
Showing with 2,022 additions and 1,325 deletions.
  1. +0 −19 python/auto_sip.blacklist
  2. +134 −24 python/server/qgsaccesscontrol.sip
  3. +83 −66 python/server/qgsaccesscontrolfilter.sip
  4. +2 −2 python/server/qgsbufferserverrequest.sip
  5. +41 −35 python/server/qgscapabilitiescache.sip
  6. +58 −30 python/server/qgsconfigcache.sip
  7. +35 −34 python/server/qgsmapserviceexception.sip
  8. +58 −44 python/server/qgsserver.sip
  9. +84 −31 python/server/qgsserverexception.sip
  10. +64 −51 python/server/qgsserverfilter.sip
  11. +107 −109 python/server/qgsserverinterface.sip
  12. +157 −39 python/server/qgsserverprojectparser.sip
  13. +308 −238 python/server/qgsserverprojectutils.sip
  14. +113 −114 python/server/qgsserverrequest.sip
  15. +116 −91 python/server/qgsserverresponse.sip
  16. +95 −63 python/server/qgsserversettings.sip
  17. +56 −47 python/server/qgsservice.sip
  18. +40 −36 python/server/qgsservicemodule.sip
  19. +78 −67 python/server/qgsserviceregistry.sip
  20. +165 −44 python/server/qgswmsconfigparser.sip
  21. +144 −105 python/server/qgswmsprojectparser.sip
  22. +4 −1 scripts/sipify.pl
  23. +4 −0 src/server/qgsaccesscontrol.h
  24. +2 −2 src/server/qgsbufferserverrequest.h
  25. +5 −6 src/server/qgsconfigcache.h
  26. +5 −1 src/server/qgsserver.h
  27. +14 −2 src/server/qgsserverexception.h
  28. +12 −7 src/server/qgsserverinterface.h
  29. +1 −1 src/server/qgsserverprojectparser.h
  30. +7 −0 src/server/qgsserverprojectutils.h
  31. +10 −6 src/server/qgsserverrequest.h
  32. +4 −1 src/server/qgsserversettings.h
  33. +5 −0 src/server/qgsservice.h
  34. +8 −4 src/server/qgswmsconfigparser.h
  35. +3 −5 src/server/qgswmsprojectparser.h
@@ -1,21 +1,2 @@
core/conversions.sip
core/qgsexception.sip
server/qgsserverfilter.sip
server/qgsserverinterface.sip
server/qgsaccesscontrolfilter.sip
server/qgsaccesscontrol.sip
server/qgsmapserviceexception.sip
server/qgscapabilitiescache.sip
server/qgsserverprojectparser.sip
server/qgswmsconfigparser.sip
server/qgswmsprojectparser.sip
server/qgsconfigcache.sip
server/qgsserversettings.sip
server/qgsserverprojectutils.sip
server/qgsserver.sip
server/qgsserverrequest.sip
server/qgsserverresponse.sip
server/qgsserverexception.sip
server/qgsservice.sip
server/qgsservicemodule.sip
server/qgsserviceregistry.sip
@@ -1,33 +1,143 @@
/***************************************************************************
qgsaccesscontrol.sip
--------------------
Access control helper for Qgis Server plugins

begin : 2015-05-19
copyright : (C) 2015 by Stéphane Brunner
email : stephane dot brunner at camptocamp dot org
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

/**
* \class QgsAccessControl
* \brief Class defining access control helper for QGIS Server.
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsaccesscontrol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/







class QgsAccessControl : QgsFeatureFilterProvider
{
%Docstring
A helper class that centralize the restrictions given by all the
access control filter plugins.
*
%End

%TypeHeaderCode
#include "qgsaccesscontrol.h"

#include "qgsaccesscontrolfilter.h"
%End
public:
QgsAccessControl();
%Docstring
Constructor
%End

QgsAccessControl( const QgsAccessControl &copy );
%Docstring
Constructor
%End


~QgsAccessControl();

void resolveFilterFeatures( const QList<QgsMapLayer *> &layers );
%Docstring
Resolve features' filter of layers
\param layers to filter
%End

void filterFeatures( const QgsVectorLayer *layer, QgsFeatureRequest &filterFeatures ) const;
%Docstring
Filter the features of the layer
\param layer the layer to control
\param filterFeatures the request to fill
%End

#include <QMultiMap>
QgsFeatureFilterProvider *clone() const /Factory/;
%Docstring
Return a clone of the object
:return: A clone
:rtype: QgsFeatureFilterProvider
%End

QString extraSubsetString( const QgsVectorLayer *layer ) const;
%Docstring
Return an additional subset string (typically SQL) filter
\param layer the layer to control
:return: the subset string to use
:rtype: str
%End

bool layerReadPermission( const QgsMapLayer *layer ) const;
%Docstring
Return the layer read right
\param layer the layer to control
:return: true if it can be read
:rtype: bool
%End

bool layerInsertPermission( const QgsVectorLayer *layer ) const;
%Docstring
Return the layer insert right
\param layer the layer to control
:return: true if we can insert on it
:rtype: bool
%End

bool layerUpdatePermission( const QgsVectorLayer *layer ) const;
%Docstring
Return the layer update right
\param layer the layer to control
:return: true if we can do an update
:rtype: bool
%End

bool layerDeletePermission( const QgsVectorLayer *layer ) const;
%Docstring
Return the layer delete right
\param layer the layer to control
:return: true if we can do a delete
:rtype: bool
%End

QStringList layerAttributes( const QgsVectorLayer *layer, const QStringList &attributes ) const;
%Docstring
Return the authorized layer attributes
\param layer the layer to control
\param attributes the list of attribute
:return: the list of visible attributes
:rtype: list of str
%End

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 the feature
:rtype: bool
%End

bool fillCacheKey( QStringList &cacheKey ) const;
%Docstring
Fill the capabilities caching key
\param cacheKey the list to fill with a cache variant
:return: false if we can't create a cache
:rtype: bool
%End

void registerAccessControl( QgsAccessControlFilter *accessControl, int priority = 0 );
%Docstring
Register an access control filter
\param accessControl the access control to add
\param priority the priority used to define the order
%End

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/server/qgsaccesscontrol.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -1,52 +1,44 @@
/***************************************************************************
qgsaccesscontrolfilter.sip
--------------------------
Access control interface for Qgis Server plugins

begin : 2015-05-19
copyright : (C) 2015 by Stéphane Brunner
email : stephane dot brunner at camptocamp dot org
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

/**
* \ingroup server
* \class QgsAccessControlFilter
* \brief 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()
*/
/************************************************************************
* 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:
/** Constructor
* QgsServerInterface passed to plugins constructors
* and must be passed to QgsAccessControlFilter instances.
*/

QgsAccessControlFilter( const QgsServerInterface *serverInterface );
/** Destructor */
%Docstring
Constructor
QgsServerInterface passed to plugins constructors
and must be passed to QgsAccessControlFilter instances.
%End

virtual ~QgsAccessControlFilter();

/** Describe the layer permission */
struct LayerPermissions
{
bool canRead;
@@ -55,45 +47,70 @@ class QgsAccessControlFilter
bool canDelete;
};

/** Return the QgsServerInterface instance*/
const QgsServerInterface *serverInterface() const;
%Docstring
Return the QgsServerInterface instance
:rtype: QgsServerInterface
%End

/** Return an additional expression filter
* @param layer the layer to control
* @return the filter expression
*/
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

/** Return an additional subset string (typically SQL) filter
* @param layer the layer to control
* @return the subset string
*/
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

/** Return the layer permissions
* @param layer the layer to control
* @return the permission to use on the layer
*/
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

/** 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
*/
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

/** 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
*/
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

/** Cache key to used to create the capabilities cache
* @return the cache key, "" for no cache
*/
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;
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 *
************************************************************************/
@@ -21,15 +21,15 @@ class QgsBufferServerRequest : QgsServerRequest
%End
public:

QgsBufferServerRequest( const QString &url, Method method = GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers( ), QByteArray *data = 0 );
QgsBufferServerRequest( const QString &url, QgsServerRequest::Method method = QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers( ), QByteArray *data = 0 );
%Docstring
Constructor

\param url the url string
\param method the request method
%End

QgsBufferServerRequest( const QUrl &url, Method method = GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers( ), QByteArray *data = 0 );
QgsBufferServerRequest( const QUrl &url, QgsServerRequest::Method method = QgsServerRequest::GetMethod, const QgsServerRequest::Headers &headers = QgsServerRequest::Headers( ), QByteArray *data = 0 );
%Docstring
Constructor

0 comments on commit b7d524c

Please sign in to comment.
You can’t perform that action at this time.