Thank you Graham for your reply,

your advice is correct, the REST API does indeed show the layer groups for
unauthenticated users. However, I would also like to have these layer
groups included in the capabilities document, so WMS clients that don't use
the REST service (e.g. QGIS) could see them. I'm wondering if hiding the
layer groups from the capabilities document in this case is intended
behaviour or possibly a bug. Any advice would be much appreciated!

Best regards,
Mikael

On Mon, 1 Apr 2019 at 00:27, Humphries, Graham (StateGrowth) <
graham.humphr...@stategrowth.tas.gov.au> wrote:

> You can get the layer groups from the REST service.
>
> EG: https://<host>/geoserver/rest/workspaces/ssg/layergroups.json
>
>
>
> Cheers,
>
> Graham H
>
>
>
> *From:* Mikael Vaaltola [mailto:mik...@gispo.fi]
> *Sent:* Saturday, 30 March 2019 1:38 AM
> *To:* geoserver-users@lists.sourceforge.net
> *Subject:* [Geoserver-users] Layer groups not appearing in WMS
> GetCapabilities
>
>
>
> Hello everyone,
>
>
>
> I'm having issues with GeoServer layer security and layer groups. I would
> like to have a global rule to prevent unauthenticated users access, and
> then manually designate layers, layer groups and workspaces that
> unauthenticated users can read. My problem is that layer groups are not
> returned in the GetCapabilities request for unauthenticated users despite
> giving read access.
>
>
>
> I tested this with GS 2.15.0 on W10 using the Windows installer and
> default data. I created a "tasmania_group" layer group inside the topp
> workspace. The layer group mode is single and the layer group contains only
> the topp:tasmania_roads layer with the CRS and bounds properly set. I have
> the following rules in layers.properties:
>
>
>
> *.*.r=ROLE_AUTHENTICATED,GROUP_ADMIN,ADMIN # prevent unauthenticated users
> from reading anything
>
> *.*.w=GROUP_ADMIN,ADMIN
>
> topp.*.*r=* # allow everyone to read the topp workspace
>
> tasmania.r=* # allow everyone to read the global layer group tasmania that
> comes in default datadirectory
>
> topp.tasmania_group.r=* # allow everyone to read the layer group I created
>
> mode=HIDE # hide layers user does not have read access to
>
>
>
> WMS GetCapabilities request returns all layers in topp workspace for
> unauthenticated users, and all layers for authenticated users. However, the
> layer groups are not included in the GetCapabilities response for
> unauthenticated users. Unauthenticated users can still do GetMap requests
> for tasmania and topp:tasmania_group layer groups without issues.
>
>
>
> How could I get the layer groups to appear in GetCapabilities response for
> unauthenticated users? Using CHALLENGE mode is unfortunately not a suitable
> option for my use case. I have a feeling I'm missing something, but I
> couldn't find an answer in the documentation. Thank you in advance for any
> help and suggestions.
>
>
>
> Best regards,
>
> Mikael Vaaltola
>
> Gispo Oy
>
> ------------------------------
>
> CONFIDENTIALITY NOTICE AND DISCLAIMER
> The information in this transmission may be confidential and/or protected
> by legal professional privilege, and is intended only for the person or
> persons to whom it is addressed. If you are not such a person, you are
> warned that any disclosure, copying or dissemination of the information is
> unauthorised. If you have received the transmission in error, please
> immediately contact this office by telephone, fax or email, to inform us of
> the error and to enable arrangements to be made for the destruction of the
> transmission, or its return at our cost. No liability is accepted for any
> unauthorised use of the information contained in this transmission.
>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to