georchestra / mapstore2-georchestra

geOrchestra newest viewer
Other
6 stars 23 forks source link

[FeatureEditor] - Prohibit geometry edition for some roles #687

Closed Gaetanbrl closed 5 months ago

Gaetanbrl commented 6 months ago

This enhancement is suggested by Geo2France (@vfabry @Doctor-Who)

Targeted version

>= release https://github.com/georchestra/mapstore2-georchestra/releases/tag/2023.02.00-RC4-geOrchestra

Linked issue

MapStore2 issue will be create soon

Description

Current behavior

Currently, FeatureEditor plugin allow to restrict geometry and attributes modifications to some roles via editionAllowedRoles config.

Here an example from current behavior where ROLE_A and ADMIN can fullly edit geometry and every attributes :

{
  "name": "FeatureEditor",
  "cfg": {
    "editingAllowedRoles": ["ADMIN", "ROLE_A"]
  }
}

With this config, MapStore2 will use a specific toolbar component (located in FeatureGrid header).

image

Expected behavior

Here, some use cases for a better understanding.

As Economic Plot reporter, I need to open mapstore context and see available plots, In order to update plot activity / status (attributes)

As Plot monitoring officer, I need to open attributes edition to several roles, In order to draw some plots and ask to reports to update attributes without the right to change the geometry (plots geometry is under is my responsability)

Targeted behavior :

To do that, we propose to insert a new editingAttributesAllowedRoles in FeatureEditor config :

note that editingAttributesAllowedRoles config name can change according to the community's suggestions

{
  "name": "FeatureEditor",
  "cfg": {
    "editingAllowedRoles": ["ADMIN", "ROLE_A"],
    "editingAttributesAllowedRoles": ["ROLE_B"]
  }
}

With this example :

For this improvement, note that :

What kind of improvement you want to add? (check one with "x", remove the others)

Gaetanbrl commented 5 months ago

I close. More details are available here : https://groups.google.com/u/1/g/mapstore-users/c/Z7yMkCBfAHQ