-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#7422: StyleEditor plugin must not rely on the workspace prefix inside the style names returned by GetCapabilities #7423
#7422: StyleEditor plugin must not rely on the workspace prefix inside the style names returned by GetCapabilities #7423
Conversation
…mation about styles
Hi @allyoucanmap, I have few questions
Style selected: tiger_roads (layer - ny_roads) Apart from the ones above everything looks fine to me. |
@dsuren1 we discussed with @tdipisa that due to new changes on new version of GeoServer the style editor will work only with the style available in its own workspace.
Unfortunately mapstore is currently assuming that the first style it recieves in the list of available styles is the default style and this particular style has styles from different workspaces. I need to investigate further to understand how to fix this and I would like to create a new issue including the splitting of concepts such as style selection and style editor (style editor should never work with capabilities at this point) @tdipisa
we should be able to select the style with this new commit 91a1d4a . Before we stored the default style with an empty string but with this fix that store the actual name we should be able to see the correct style in the map
This is the behaviour we want from now on only styles of the same workspace of the layer can be edited. The GeoServer is showing the list of all styles even if the GetCapabilities is targeting a specific workspace, this behaviour is not correct and it should be a fix in the future that it will remove all the styles outside the workspace |
@allyoucanmap I would like to do an additional step directly within this PR to make things more clear for the user:
@allyoucanmap, then you can also open a new issue to investigate/discuss a possible improvement to detach the selection part from the editing part and put in in 2021.02.01 or 2021.03.00 according also to the ms-geonode-client needs @giohappy. |
@tdipisa can you calrofy why editing a style in the global workspace will be disabled? |
@giohappy this was my understanding according to the recent GS updates and my discussion with @allyoucanmap. If there is still the ability to edit the global styles, why didn't you mention this in our call @allyoucanmap? |
@tdipisa I'm sorry I'll check later |
let's recap @allyoucanmap. From the discussion with @aaime global styles or styles from other workspaces souldn't leask into the GetCapabilities under a workspace. So, if the style editor only relies on the workspaced GC the user shouldn never see styles from outside the workspace itself. BUT currently Geoserver has a bug and external styles are also listed, although without any means to tell where those styles are coming from. In any case I don't think this affects the ability to edit a global style. Does it? |
Let's meet again @giohappy and @allyoucanmap if needed |
@giohappy yes, you can edit the global styles. I got confused, now I'm working on the fix |
Global style can legitimately leak into a workspace specific caps document, unless they end up being covered by a same-named local style (in that case, the latter wins). Styles from other workspaces should not be there instead. |
@aaime so if I a style is used inside requests toward a workspace, without prefixing its name with the workspace, either a global or a local style is selected automatically. Do I understand it correctly? |
If the service used is workspace specific (the workspace appears in the path) and there is a naming conflict between local and global styles, the local one is picked. It should not be possible to access the global one in that situation. |
@ElenaGallo all good for me in DEV. Please do a double check and let us know for the backport to 2021.02.xx. |
Test passed, @allyoucanmap please backport to 2021.02.xx. |
…ce prefix inside the style names returned by GetCapabilities (geosolutions-it#7423) * replace get capabilities request with GeoServer rest api to get information about styles * get missing styles information from get capabilities * store the current default style name * remove restriction on workspace for editing
…de the style names returned by GetCapabilities (#7423) * replace get capabilities request with GeoServer rest api to get information about styles * get missing styles information from get capabilities * store the current default style name * remove restriction on workspace for editing
Description
This PR replaces the request GetCapabilities of the style editor with a rest/layers request to get the correct styles information. If the rest/layer request fails it fallback to GetCapabilities request to enable the styles selector
The Style Editor will work only with the styles included in the same workspace.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x", remove the others)
Issue
What is the current behavior?
#7422
What is the new behavior?
Styles can be edited and deleted if the users have permission
Breaking change
Does this PR introduce a breaking change? (check one with "x", remove the other)
Other useful information