Skip to content

Feature/dxf export+access control#667

Merged
rldhont merged 2 commits into3liz:masterfrom
meyerlor:feature/dxf-export+access-control
Feb 3, 2026
Merged

Feature/dxf export+access control#667
rldhont merged 2 commits into3liz:masterfrom
meyerlor:feature/dxf-export+access-control

Conversation

@meyerlor
Copy link
Copy Markdown
Collaborator

@meyerlor meyerlor commented Dec 1, 2025

Sorry for double PR, renamed my branch and was not aware this would delete the original PR.

Implements access control configuration for DXF export functionality in the QGIS plugin. This allows administrators to restrict DXF export by user groups and configure which WFS layers are exportable.

To test the plugin, you can download it here

Features:

  • Global "Allow DXF export" checkbox to enable/disable the feature
  • "Allowed groups" field for comma-separated Lizmap group IDs
  • Auto-populated table of all WFS-enabled layers with individual enable/disable checkboxes
  • Custom DXF export icon in navigation panel
  • Full CFG file save/load support with backward compatibility

Implementation:

  • Created dedicated DXF Export panel (lizmap/resources/ui/ui_form_dxf_export.ui)
  • Added DxfExportDefinitions for configuration schema
  • Implemented TableManagerDxfExport for WFS layer management
  • Registered global options (dxfExportEnabled, allowedGroups) in config.py
  • Added icon resources (19-dxfexport-dark.png, 19-dxfexport-white.png)
  • Connected UI widgets to save/load framework

The configuration is stored in the .qgs.cfg file as:

  • options.dxfExportEnabled (boolean, default: false)
  • options.allowedGroups (string, comma-separated group IDs)
  • dxfExport.layers[] (array of {layerId, enabled} objects)

Backward compatibility is ensured:

  • Old CFG files without these keys use safe defaults (disabled)
  • DXF export is disabled by default for existing projects
  • Empty allowedGroups means all users are allowed (when enabled)

Note: This only implements the configuration UI in the plugin. Access control
enforcement in lizmap-web-client will be implemented separately.

Working plugin with the changes included:
grafik

Example parts of the .qgs.cfg:

    "options": {
        "projection": {
            "proj4": "+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs",
            "ref": "EPSG:25832"
        },
        "bbox": [
            "509381.00309999997261912",
            "5279935.23770000040531158",
            "544169.05689999996684492",
            "5303809.39219999965280294"
        ],
        "mapScales": [
            10000,
            25000,
            50000,
            100000,
            250000,
            500000
        ],
        "minScale": 1,
        "maxScale": 1000000000,
        "use_native_zoom_levels": false,
        "hide_numeric_scale_value": false,
        "initialExtent": [
            509381.0031,
            5279935.2377,
            544169.0569,
            5303809.3922
        ],
        "popupLocation": "dock",
        "pointTolerance": 25,
        "lineTolerance": 10,
        "polygonTolerance": 5,
        "automatic_permalink": true,
        "tmTimeFrameSize": 10,
        "tmTimeFrameType": "seconds",
        "tmAnimationFrameLength": 1000,
        "datavizLocation": "dock",
        "theme": "dark",
        "fixed_scale_overview_map": true,
        "dxfExportEnabled": true,
        "allowedGroups": "admins,publishers",
        "dataviz_drag_drop": [],
        "default_background_color_index": 9

Two layer's config example:

        "Skizzen_Punkte": {
            "id": "Skizzen_Punkte_9d9588dc_6db2_435c_9c99_8762a61b5b20",
            "name": "Skizzen_Punkte",
            "type": "layer",
            "geometryType": "point",
            "extent": [
                533969.2096999998,
                5286065.003134375,
                533969.2096999998,
                5286065.003134375
            ],
            "crs": "EPSG:25832",
            "title": "Skizzen_Punkte",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "False",
            "popup": "False",
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "children_lizmap_features_table": true,
            "popupDisplayChildren": "False",
            "popup_allow_download": true,
            "legend_image_option": "hide_at_startup",
            "groupAsLayer": "False",
            "baseLayer": "False",
            "displayInLegend": "True",
            "group_visibility": [],
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "clientCacheExpiration": 300,
            "dxfExportEnabled": true
        },
        "Skizzen_Linien": {
            "id": "Skizzen_Linien_34e06de2_adf7_4402_a524_0e58bfdf3436",
            "name": "Skizzen_Linien",
            "type": "layer",
            "geometryType": "line",
            "extent": [
                522999.84375,
                5285054.0,
                528079.875,
                5287674.0
            ],
            "crs": "EPSG:25832",
            "title": "Skizzen_Linien",
            "abstract": "",
            "link": "",
            "minScale": 1,
            "maxScale": 1000000000000,
            "toggled": "False",
            "popup": "False",
            "popupSource": "auto",
            "popupTemplate": "",
            "popupMaxFeatures": 10,
            "children_lizmap_features_table": true,
            "popupDisplayChildren": "False",
            "popup_allow_download": true,
            "legend_image_option": "hide_at_startup",
            "groupAsLayer": "False",
            "baseLayer": "False",
            "displayInLegend": "True",
            "group_visibility": [],
            "singleTile": "True",
            "imageFormat": "image/png",
            "cached": "False",
            "clientCacheExpiration": 300,
            "dxfExportEnabled": false
        },

@rldhont
Copy link
Copy Markdown
Contributor

rldhont commented Dec 1, 2025

Hi @meyerlor,

Thanks for your contribution. We have update the code for configuration, sorry for that.
Can you rebase and update your PR ? Thanks.

@meyerlor meyerlor force-pushed the feature/dxf-export+access-control branch from 1266d79 to e782286 Compare December 1, 2025 14:39
@meyerlor
Copy link
Copy Markdown
Collaborator Author

meyerlor commented Dec 1, 2025

@rldhont no problem! I rebased - should be ok now i think. Local tests were passing!

@meyerlor meyerlor force-pushed the feature/dxf-export+access-control branch from 73ddd40 to 6088f6b Compare December 1, 2025 18:29
@dmarteau dmarteau force-pushed the master branch 3 times, most recently from 0e9c376 to 73662c6 Compare January 2, 2026 13:08
@meyerlor meyerlor force-pushed the feature/dxf-export+access-control branch from 6088f6b to 4c27481 Compare January 31, 2026 12:03
Implement access control for DXF export in the QGIS plugin:
- Global enable/disable checkbox for DXF export
- Allowed groups field for restricting access by Lizmap group IDs
- Auto-populated table of WFS-enabled layers with individual toggles
- New DXF Export panel with dedicated icon in navigation
- Full CFG file save/load support with backward compatibility

Also fixes LwcVersions.oldest() missing return and version_checker call.
@meyerlor meyerlor force-pushed the feature/dxf-export+access-control branch from 4c27481 to bc56b8c Compare January 31, 2026 12:05
@rldhont rldhont added the UX label Jan 31, 2026
Copy link
Copy Markdown
Contributor

@rldhont rldhont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all

Comment thread lizmap/widgets/html_editor.py Outdated
QWebSettings is used in the code, making the noqa directive unnecessary.
@rldhont rldhont merged commit e1b5d4e into 3liz:master Feb 3, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants