Can't edit layers geometry within "user" role in mapstore2

23 views
Skip to first unread message
Assigned to lorenzo...@geosolutionsgroup.com by me

Shefqet LULJA

unread,
Mar 29, 2024, 3:20:28 AMMar 29
to mapstor...@googlegroups.com
Hi,
I have setup some users for my webapps, and in mapstore's maps i set them as editor and not viewers, and now they can only edit the maps, but they can't edit geometries of the layers (digitize, delete, change attributes), they can edit only if i move them to admin, is there a possibilities to set user to be able to edit geometries of layers without making them admins?

Lorenzo Natali

unread,
Mar 29, 2024, 4:57:30 AMMar 29
to mapstore-users
Hi, 
Given that you integrated users between MapStore and GeoServer, you can create a group on MapStore (and so a role on GeoServer) that can edit layers.
Make the group on GeoServer able to edit features and configure the FeatureEditor plugin to make this group able to edit by setting the property `editingAllowedGroups` (see documentation

Hope it helps.

Shefqet LULJA

unread,
Apr 2, 2024, 3:45:12 AMApr 2
to mapstor...@googlegroups.com
I haven't integrated, just simple setup, every apps separated by it's own. 

--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/6ed7e668-7d35-4921-a293-7b20269ff09cn%40googlegroups.com.

Lorenzo Natali

unread,
Apr 2, 2024, 3:55:13 AMApr 2
to mapstor...@googlegroups.com
If so, 
setting the editingAllowedGroups, the editing  tools will show for the given groups. 
Anyway the fact that you can effectively write on the layer is up to GeoServer security. 
If it is not allowed by it, on save request you will receive an error message.


Shefqet LULJA

unread,
Apr 3, 2024, 3:13:13 AMApr 3
to mapstor...@googlegroups.com
Hi,

I have it like this in my localconfig.json file

************** This is a part of the code     
   "position": 11
                  }
                }
            },
            {
                "name": "Locate",
                "override": {
                    "Toolbar": {
                        "alwaysVisible": true
                    }
                }
            }, "Home", "FeatureEditor",
            "LayerDownload",
            {
              "name": "QueryPanel",
              "cfg": {
                  "activateQueryTool": true,
                  "spatialOperations": [
                      {"id": "INTERSECTS", "name": "queryform.spatialfilter.operations.intersects"},
                      {"id": "CONTAINS", "name": "queryform.spatialfilter.operations.contains"},
                      {"id": "WITHIN", "name": "queryform.spatialfilter.operations.within"}
                  ],
                  "spatialMethodOptions": [

***********************
Does this mean that FeatureEditor is there but not configure, cause i dont see anything else in localconfig file to add USER group as editingAllowedGroups

Lorenzo Natali

unread,
Apr 5, 2024, 12:13:16 PMApr 5
to mapstor...@googlegroups.com
Hi,
to configure it you can replace "FeatureEditor" with an JSON object like this

{
"name": "FeatureEditor",
"cfg": {
    "editingAllowedGroups" [ "group1", "group2"]
}
Where "group1", "group2" are the group names you want to enable the editing tools for.

Shefqet LULJA

unread,
Apr 19, 2024, 5:18:57 AMApr 19
to mapstor...@googlegroups.com
When I add this object, my web application becomes blank, and I try to restart the service, same thing. I had to revert changes back (to only  ,"FeatureEditor",  ) and it is ok. Why adding this code breaks the web application. I tried to to put the code to localconfigs.json file, i added only one extra " }" at your code (i tried with and without extra  "}"  )
 {
"name": "FeatureEditor",
"cfg": {
    "editingAllowedGroups" [ "ADMIN", "UEDITOR"]
}}

p.s i have to say that my apps is not integrated with geoserver, they are just 2 separated apps, but i have added UEDITOR roles just in case to have editing capabilities, actually i removed all the restriction, just to test the editing capabilities by all users that could be denied by geoserver in anycase, and so could try to focus only on mapstore managing users editing capabilities through user and roles.

Lorenzo Natali

unread,
Apr 22, 2024, 4:27:59 AMApr 22
to mapstore-users
Hi,
sorry, I did a couple of errors in JSON syntax, writing it by hand and not trying, assuming you know this ynt

Here a reference about JSON syntax that can be useful to identify errors on your own, also in the future: 


Other than the "}", there was also a missing ":

The exact correct syntax is

[... something] , 
{
"name": "FeatureEditor",
"cfg": {
    "editingAllowedGroups": [ "ADMIN", "UEDITOR"]
 }
}
, [ something more]

In JSON arrays like this, comma separates various elements, that in this case can be strings (e.g. "PluginName") or objects ({"name": "PluginName", "cfg": {...} }).

Hope it helps

Shefqet LULJA

unread,
Apr 22, 2024, 5:29:22 AMApr 22
to mapstor...@googlegroups.com
Yeah, it worked now. Great.

Reply all
Reply to author
Forward
0 new messages