Skip to content

Add support for parameter roles in featureType filter and groupRoles for events#158

Open
Phocacius wants to merge 2 commits intomasterfrom
work/add-roles-parameter-to-filter
Open

Add support for parameter roles in featureType filter and groupRoles for events#158
Phocacius wants to merge 2 commits intomasterfrom
work/add-roles-parameter-to-filter

Conversation

@Phocacius
Copy link
Copy Markdown
Member

Can be used to managed the access to digitizer entries based on mapbender groups.

In the filter query you can use the additional parameter :roles, which is prefilled with all the currently logged-in users groups (including ROLE_USER when the user is logged in).

In an event, you can use the additional variable $groupRoles (in addition to $userRoles) which contains only the roles starting with ROLE_GROUP, excluding e.g. ROLE_USER.

Example configuration (assuming in the digitizer table there's a column mapbender_group):

groupfilteredtable:
  label: Group filtered table
  maxResults: 500
  featureType:
    connection: geodb
    table: geotable
    uniqueId: gid
    geomType: point
    geomField: geom
    srid: 25832
    filter: 'mapbender_group in (:roles)'
    events:
      onBeforeSave: "$feature->setAttribute('mapbender_group', implode(', ', $groupRoles));"

@Phocacius Phocacius requested a review from astroidex May 10, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant