mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
Removed unused and unuseful method + typo
This commit is contained in:
parent
20652c8963
commit
f5e4a7c535
@ -111,19 +111,6 @@ This method takes into account the ACL restrictions provided by QGIS Server Acce
|
|||||||
%End
|
%End
|
||||||
|
|
||||||
|
|
||||||
static const QVector<QgsMapLayer *> editableWfsLayers( const QgsServerApiContext &context );
|
|
||||||
%Docstring
|
|
||||||
Returns the list of layers accessible to the service in edit mode for a given ``context``.
|
|
||||||
|
|
||||||
This method takes into account the ACL restrictions provided by QGIS Server Access Control plugins.
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
project must not be NULL
|
|
||||||
|
|
||||||
.. versionadded:: 3.12
|
|
||||||
%End
|
|
||||||
|
|
||||||
|
|
||||||
static QString sanitizedFieldValue( const QString &value );
|
static QString sanitizedFieldValue( const QString &value );
|
||||||
%Docstring
|
%Docstring
|
||||||
|
@ -568,15 +568,6 @@ const QVector<QgsVectorLayer *> QgsServerApiUtils::publishedWfsLayers( const Qgs
|
|||||||
return publishedWfsLayers< QgsVectorLayer * >( context );
|
return publishedWfsLayers< QgsVectorLayer * >( context );
|
||||||
}
|
}
|
||||||
|
|
||||||
const QVector<QgsMapLayer *> QgsServerApiUtils::editableWfsLayers( const QgsServerApiContext &context )
|
|
||||||
{
|
|
||||||
QVector<QgsMapLayer *> result;
|
|
||||||
const QStringList wfstUpdateLayerIds = QgsServerProjectUtils::wfstUpdateLayerIds( *context.project() );
|
|
||||||
const QStringList wfstInsertLayerIds = QgsServerProjectUtils::wfstInsertLayerIds( *context.project() );
|
|
||||||
const QStringList wfstDeleteLayerIds = QgsServerProjectUtils::wfstDeleteLayerIds( *context.project() );
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
QString QgsServerApiUtils::sanitizedFieldValue( const QString &value )
|
QString QgsServerApiUtils::sanitizedFieldValue( const QString &value )
|
||||||
{
|
{
|
||||||
QString result { QUrl( value ).toString() };
|
QString result { QUrl( value ).toString() };
|
||||||
|
@ -201,58 +201,6 @@ class SERVER_EXPORT QgsServerApiUtils
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the list of layers accessible to the service in edit mode for a given \a context.
|
|
||||||
*
|
|
||||||
* This method takes into account the ACL restrictions provided by QGIS Server Access Control plugins.
|
|
||||||
*
|
|
||||||
* \note project must not be NULL
|
|
||||||
* \since QGIS 3.12
|
|
||||||
*/
|
|
||||||
static const QVector<QgsMapLayer *> editableWfsLayers( const QgsServerApiContext &context );
|
|
||||||
|
|
||||||
#ifndef SIP_RUN
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the list of layers of type T accessible to the WFS service in edit mode for a given \a project.
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
*
|
|
||||||
* QVector<QgsVectorLayer*> vectorLayers = editableWfsLayers<QgsVectorLayer>();
|
|
||||||
*
|
|
||||||
* \note not available in Python bindings
|
|
||||||
*/
|
|
||||||
template <typename T>
|
|
||||||
static const QVector<T> editableWfsLayers( const QgsServerApiContext &context, QgsServerRequest::Method &method )
|
|
||||||
{
|
|
||||||
#ifdef HAVE_SERVER_PYTHON_PLUGINS
|
|
||||||
QgsAccessControl *accessControl = context.serverInterface()->accessControls();
|
|
||||||
#endif
|
|
||||||
const QgsProject *project = context.project();
|
|
||||||
QVector<T> result;
|
|
||||||
if ( project )
|
|
||||||
{
|
|
||||||
const QStringList wfsLayerIds = QgsServerProjectUtils::wfsLayerIds( *project );
|
|
||||||
const auto constLayers { project->layers<T>() };
|
|
||||||
for ( const auto &layer : constLayers )
|
|
||||||
{
|
|
||||||
if ( ! wfsLayerIds.contains( layer->id() ) )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#ifdef HAVE_SERVER_PYTHON_PLUGINS
|
|
||||||
if ( accessControl && !accessControl->layerInsertPermission( layer ) )
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
result.push_back( layer );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sanitizes the input \a value by removing URL encoding and checking for malicious content.
|
* Sanitizes the input \a value by removing URL encoding and checking for malicious content.
|
||||||
|
@ -1035,7 +1035,7 @@ json QgsWfs3CollectionsItemsHandler::schema( const QgsServerApiContext &context
|
|||||||
{ "description", "Forbidden: the operation requested was not authorized" }
|
{ "description", "Forbidden: the operation requested was not authorized" }
|
||||||
},
|
},
|
||||||
"500", {
|
"500", {
|
||||||
{ "description", "Posted data could not be parsed correctly or another error occourred" }
|
{ "description", "Posted data could not be parsed correctly or another error occurred" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "default", defaultResponse() }
|
{ "default", defaultResponse() }
|
||||||
@ -1965,7 +1965,7 @@ json QgsWfs3CollectionsFeatureHandler::schema( const QgsServerApiContext &contex
|
|||||||
{ "description", "Forbidden: the operation requested was not authorized" }
|
{ "description", "Forbidden: the operation requested was not authorized" }
|
||||||
},
|
},
|
||||||
"500", {
|
"500", {
|
||||||
{ "description", "Posted data could not be parsed correctly or another error occourred" }
|
{ "description", "Posted data could not be parsed correctly or another error occurred" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "default", defaultResponse() }
|
{ "default", defaultResponse() }
|
||||||
@ -1989,7 +1989,7 @@ json QgsWfs3CollectionsFeatureHandler::schema( const QgsServerApiContext &contex
|
|||||||
{ "description", "Forbidden: the operation requested was not authorized" }
|
{ "description", "Forbidden: the operation requested was not authorized" }
|
||||||
},
|
},
|
||||||
"500", {
|
"500", {
|
||||||
{ "description", "Posted data could not be parsed correctly or another error occourred" }
|
{ "description", "Posted data could not be parsed correctly or another error occurred" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "default", defaultResponse() }
|
{ "default", defaultResponse() }
|
||||||
@ -2013,7 +2013,7 @@ json QgsWfs3CollectionsFeatureHandler::schema( const QgsServerApiContext &contex
|
|||||||
{ "description", "Forbidden: the operation requested was not authorized" }
|
{ "description", "Forbidden: the operation requested was not authorized" }
|
||||||
},
|
},
|
||||||
"500", {
|
"500", {
|
||||||
{ "description", "Posted data could not be parsed correctly or another error occourred" }
|
{ "description", "Posted data could not be parsed correctly or another error occurred" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ "default", defaultResponse() }
|
{ "default", defaultResponse() }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user